Re: [julia-users] Re: DataArray Concatenation

2014-09-25 Thread John Myles White
Thanks, but these days I'd say Simon Kornblith deserves the credit for what's good about DataArrays. -- John On Sep 25, 2014, at 8:11 AM, Li Zhang wrote: > I would very much like to contribute, but i am not sure if i had time, some > projects are keeping me busy. would to look at it when i h

[julia-users] Re: DataArray Concatenation

2014-09-25 Thread Li Zhang
I would very much like to contribute, but i am not sure if i had time, some projects are keeping me busy. would to look at it when i have spare time. By the way, john, great work for julia statistics:) On Tuesday, September 23, 2014 9:11:20 PM UTC-4, Li Zhang wrote: > > > > a=@data([NA,3,5,7,NA

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
Would be great to submit a pull request implementing the missing funtionality. -- John On Sep 24, 2014, at 6:06 PM, Li Zhang wrote: > i tried methods in base for Dequeues, but it seems some of them are not > implemented for DataArray. > For example: > > a=@data([NA,3,5,7,NA,3,7]) > b=copy(a[

[julia-users] Re: DataArray Concatenation

2014-09-24 Thread Li Zhang
i tried methods in base for Dequeues, but it seems some of them are not implemented for DataArray. For example: a=@data([NA,3,5,7,NA,3,7]) b=copy(a[2:end]) append!(b,[NA]) append! works, but prepend! gives no methods error. also deleteat! works but insert! no methods. anyway, other methods wo

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
Please don’t conflate NaN and NA. You should _never_ use NaN unless you’re working with an Array, not a DataArray. — John On Sep 24, 2014, at 7:48 AM, muraveill wrote: > @data([NaN]) already correctly returns DataArray(Float64, 1). If people mix > NA's inside, it should return an Any type. >

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
@data([NaN]) already correctly returns DataArray(Float64, 1). If people mix NA's inside, it should return an Any type. The problem is when it comes from data that is all NA in some parts, like results of statistical tests with zero variance etc., and you want @data(subset_of_the_data). But stat

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
I think that DataArray{Any, 1} is probably the best thing you could possibly do. But it’s still going to cause people lots of problems, because there’s almost never a time when you’d want to work with DataArray{Any, 1}. At some point, we have to improve the @data macro. But for this use case, I

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
I was about to say DataArray{NAtype,1}. But then the type cannot be changed according to what is added to it, right ? Then DataArray{Any,1}. Just as @data(["asdf" NA; NA 1.4]). On Wednesday, 24 September 2014 16:25:17 UTC+2, John Myles White wrote: > > Naivete isn’t a big deal. Just try to be ver

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
Naivete isn’t a big deal. Just try to be very precise. Any literal in Julia should produce a value V of type T. What’s the type T that @data([NA]) would produce? — John On Sep 24, 2014, at 7:22 AM, muraveill wrote: > To my naive view, a data array with cells containing ony value NA. Well, it

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
julia> @data([NA NA NA; NA NA NA]) ERROR: Type of literal data cannot be inferred julia> @data([NA NA NA; NA NA 1]) 2x3 DataArray{Int64,2}: NA NA NA NA NA 1 On Wednesday, 24 September 2014 16:22:48 UTC+2, muraveill wrote: > > To my naive view, a data array with cells containing ony value N

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
To my naive view, a data array with cells containing ony value NA. Well, it works with numbers, why not NA. The error thrown is the same in two dimensions with arrays of length > 1.

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
What would @data([NA]) even mean? — John On Sep 24, 2014, at 7:12 AM, muraveill wrote: > It looks like a bug that @data([NA]) throws an error, should an issue be > filed ?

[julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
It looks like a bug that @data([NA]) throws an error, should an issue be filed ?

[julia-users] Re: DataArray Concatenation

2014-09-24 Thread muraveill
b = [@data([4]),a[1:end-1]] b = [@data([NA,4]),a[1:end-1]] work and return a DataArray. But b = [@data([NA]),a[1:end-1]] says "ERROR: Type of literal data cannot be inferred" and I don't get why. Maybe you know how to fix the latter ? On Wednesday, 24 September 2014 03:11:20 UTC+2, Li Zhang wr