julia> using DataArrays
julia> methods(array)
ERROR: array not defined
julia> methods(DataArrays.array)
ERROR: array not defined
I've got DataArrays 0.0.2. It looks like that's an old version, but I just
wiped my whole .julia and re-ran Pkg.add("DataArrays") and that's still
what got pulled down. Looks like the newer DataArrays are only compatible
with julia 0.3, so I guess the arrays function was introduced after 0.0.2?
If that's not going to be back-ported to julia 0.2 I'd be happy to track
down the places where I saw those guides and submit PRs with notes
cautioning that the examples require a later DataArrays.
I'm a little torn on what seems to be standard practice in Julia to use
"using" to pull in dependent libraries unless there's an explicit naming
conflict. I find it's a lot harder to reason about where things are coming
from.
I suppose the reason that python rules don't apply is that in
single-dispatch OOP you usually only have to name the library when you're
declaring the object and then the object itself sort of handles the
namespace issue from there on out. In julia you're much more often
referencing the global namespace when looking up function names, so needing
to have the MyPackage.array() all the time is much more of a hassle.
I guess the other strangeness is that you're referencing a *function* that
might be defined in module A, but dispatch will look up a *method* defined
in module B.
-s
On Fri, Feb 14, 2014 at 11:37 AM, John Myles White <[email protected]
> wrote:
> array is in DataArrays.
>
> -- John
>
> On Feb 14, 2014, at 7:40 AM, Spencer Russell <[email protected]> wrote:
>
> julia> using DataFrames
>
> julia> methods(array)
> ERROR: array not defined
>
> julia> methods(DataFrames.array)
> ERROR: array not defined
>
> Pkg.status() says I'm using DataFrames 0.4.2, and at startup Julia says
> it's Version 0.2.0 (2013-11-16 23:44 UTC).
>
>
> On Fri, Feb 14, 2014 at 7:29 AM, Isaiah Norton <[email protected]>wrote:
>
>> julia> DataFrames.array(<tab>
>>
>> will show where all the versions are defined.
>>
>>
>> On Fri, Feb 14, 2014 at 4:35 AM, Spencer Russell <[email protected]> wrote:
>>
>>> It seems that a lot of the machine learning examples [1] are pulling in
>>> the data from DataFrame format from RDatasets and then using an "array"
>>> function to convert them to normal arrays.
>>>
>>> Where is "array" defined? I'm having trouble figuring out how to get
>>> data from DataFrames into a normal array and my google-fu is failing me.
>>>
>>> -s
>>>
>>> [1] https://github.com/JuliaStats/SVM.jl
>>>
>>
>>
>
>