Comments (4)
I tried to look at changing the conj-rows function, but I was unable to alter it without causing more bugs (sel and $ don't return a dataset for just one row).
This function could be used within conj-rows:
(conj-rows
ab-dataset
(reorder-columns ba-dataset [:a :b]))
The conj-rows documentation should be updated to reflect the fact that it has some limitations with respect to column order.
from incanter.
@avishn does this still issue for you?
from incanter.
closed as implemented...
from incanter.
@alexott
What's the rational not fixing conj-rows at it's root? It seems to me that it's possible to do so. For example, how about
(defn conj-rows
"Returns a dataset created by combining the rows of the given datasets and/or collections.
Examples:
(use '(incanter core datasets))
(def cars (get-dataset :cars))
(view (conj-rows (to-dataset (range 5)) (to-dataset (range 5 10))))
(view (conj-rows cars cars))
(view (conj-rows [[1 2] [3 4]] [[5 6] [7 8]]))
(view (conj-rows [{:a 1 :b 2} {:a 3 :b 4}] [[5 6] [7 8]]))
(view (conj-rows (to-dataset [{:a 1 :b 2} {:a 3 :b 4}]) [[5 6] [7 8]]))
(conj-rows (range 5) (range 5 10))
"
([& args]
(reduce (fn [A B]
(let [a (to-dataset A :transpose true)
the-column-names (:column-names a)
b (reorder-columns (to-dataset B :transpose true) the-column-names)]
(dataset the-column-names
(concat (to-list a) (to-list b)))))
args)))
I wasted several hours to track down to conj-rows' peculiar behavior, by looking at the source code.
Fixing conj-rows' documentation would be helpful, but I wish to remove the burden to user as much as possible. This is a typical incidental complexity, that the user should not bear, if possible.
If you think that there is no negative impact, I can take care of the regression test for the fix. (This is how I fix it for my application.)
Thanks,
Yu
from incanter.
Related Issues (20)
- can't install artifact bouncycastle:bctsp-jdk14:jar:138 in central HOT 17
- incanter.charts relies on an apparently outdated jfreechart, which deprecated some stuff HOT 5
- Problems with linear model in Incanter 1.9.2 HOT 3
- Migrate root incanter project.clj to clojure 1.9, modules are already there. HOT 1
- IndexOutOfBoundsException when reading XLS file HOT 12
- incanter.sql error with jdbc/find-connection HOT 2
- (use '(incanter excel)) error HOT 4
- https://wiki.github.com/liebke/incanter malform issue HOT 1
- Can't save datasets unless incanter.io is loaded HOT 1
- Problems downloading artifacts from central
- wunderground API reference in README 400s HOT 2
- Integers coerce to Floats when creating a dataset from an xls document HOT 4
- Update options in some incanter.stats functions docstrings HOT 1
- Set stroke color seems to have a bug on scatter plots. HOT 2
- Error when running Incanter on Docker HOT 2
- t-test is equal for paired and unpaired samples HOT 1
- Wrong pvalue might be calculated in ttest in incanter.stats
- namespace 'incanter.excel.cells' not found, when use excel
- `[com.lowagie/itext "2.1.7"]` is vulnerable
- incanter.core/abs shadows clojure.core/abs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incanter.