You're right: any iterable could work.

Personally, I tend to minimize the use of functionality that depends upon the 
columns of a DataFrame being in a specific order. It's certainly useful in many 
cases, so we can't get rid of it. But I'm not excited about people writing a 
lot more code that depends upon order than they do now.

 -- John

On Jun 6, 2014, at 1:07 PM, Ivar Nesje <[email protected]> wrote:

> Why can't any iterable (of the correct length) be accepted?
> 
> As long as the DataFrame have predefined types on the columns, it is just a 
> matter of asserting or converting the type and copy it inn. Convert would 
> probably be slower because the types would be unknown and it would have to 
> dispatch dynamically to the right convert method.
> 
> kl. 18:58:51 UTC+2 fredag 6. juni 2014 skrev John Myles White følgende:
> Yeah, I just dislike the gratuituous multiplicity of ways to do the same 
> thing.
> 
>  -- John
> 
> On Jun 6, 2014, at 9:55 AM, Stefan Karpinski <[email protected]> wrote:
> 
>> Since all three can be indexed the same way, it seems like that should be a 
>> minimal annoyance, no?
>> 
>> On Friday, June 6, 2014, John Myles White <[email protected]> wrote:
>> The thing that annoys me about arrays is that we arguably need to accept 
>> both vectors and 1-row matrices as inputs.
>> 
>>  -- John
>> 
>> On Jun 6, 2014, at 9:20 AM, Stefan Karpinski <[email protected]> wrote:
>> 
>>> See also https://github.com/JuliaStats/DataFrames.jl/issues/585. Using a 
>>> tuple may make more sense, but it probably wouldn't hurt to allow an array 
>>> as well.
>>> 
>>> On Friday, June 6, 2014, John Myles White <[email protected]> wrote:
>>> If someone wants to submit a PR to allow adding a tuple as a row to a 
>>> DataFrame, I’ll merge it.
>>> 
>>>  — John
>>> 
>>> On May 28, 2014, at 7:43 AM, John Myles White <[email protected]> 
>>> wrote:
>>> 
>>>> I’m happy with using tuples since that will make it easier to construct 
>>>> DataFrames from iterators.
>>>> 
>>>>  — John
>>>> 
>>>> On May 27, 2014, at 11:37 PM, Tomas Lycken <[email protected]> wrote:
>>>> 
>>>>> I like it - but maybe that wasn't so hard to guess I would ;)
>>>>> 
>>>>> // T
>>>>> 
>>>>> On Tuesday, May 27, 2014 10:11:15 PM UTC+2, Jacques Rioux wrote:
>>>>> Let me add a thought here. I also think that adding a row to a dataframe 
>>>>> should be easier. However, I do not think that an array would be the best 
>>>>> container to represent a row because array members must all be of the 
>>>>> same type which brings up Any as the only options in your example.
>>>>> 
>>>>> I think that appending or pushing a tuple with the right types could be 
>>>>> made to work. 
>>>>> 
>>>>> So it would be 
>>>>> 
>>>>> julia> push!(psispread, (1.0,0.1,:Fake))
>>>>> 
>>>>> or
>>>>> 
>>>>> julia> append!(psispread, (1.0,0.1,:Fake))
>>>>> 
>>>>> since 
>>>>> 
>>>>> julia> typeof((1.0, 0.1, :fake))
>>>>> (Float64,Float64,Symbol)
>>>>> 
>>>>> Note, I am not saying that this works now but that it could be made to 
>>>>> work by adding the corresponding method to either function. It seems it 
>>>>> is the right construct.
>>>>> 
>>>>> Any thoughts?
>>>> 
>>> 
>> 
> 

Reply via email to