Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize DataFrame without specifying order #130

Closed
lokeshh opened this issue May 20, 2016 · 2 comments
Closed

Initialize DataFrame without specifying order #130

lokeshh opened this issue May 20, 2016 · 2 comments

Comments

@lokeshh
Copy link
Member

lokeshh commented May 20, 2016

I was working with DataFrame initialization and think following would be convenient to have. What are your thougts?

# Initialization with array of vectors or arrays without specifying order.
>>> a = b = (1..3).dv
>>> Daru::DataFrame.new [a, b]
#<Daru::DataFrame:27152780 @name = 9e6a7851-96f6-43cb-93af-3ef59081e9a2 @size = 3>
                    0          1 
         0          1          1 
         1          2          2 
         2          3          3 

# Initialization with array of Enumerable like ranges without specifying order.
>>> Daru::DataFrame.new [1..3, 1..3]
#<Daru::DataFrame:26079900 @name = b0fb36c0-fd41-4a7e-9a02-36823cc9e1a5 @size = 3>
                    0          1 
         0          1          1 
         1          2          2 
         2          3          3 
@v0dro
Copy link
Member

v0dro commented May 20, 2016

The first approach is alright (one with Vectors).

v0dro pushed a commit that referenced this issue Apr 12, 2017
* Adds default order for Daru::DataFrame

Rspec test added, has been written in the older format to main consistency. This will be easier to change while re-writing all tests to modern specifications file-wise. RDoc documentation has also been added.

* Refines code with ||=

* Tries resolving rubocop 0.48.1 release offenses - try #1

* Fixes Rdoc - example of Daru::DataFrame initialize without order
@athityakumar
Copy link
Member

Fixed with PR #329 - I think this issue can be closed now. 😄

@zverok zverok closed this as completed Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants