[julia-users] Re: Adding new column to dataframe

2014-05-16 Thread Sam L
df = DataFrame(A=rand(10), B=rand(10)) df[:C] = df[:A] .+ df[:B] does the trick in DataFrames v0.5.4. On Thursday, May 15, 2014 7:59:54 PM UTC-7, Jason Solack wrote: So i feel like this a simple question, but i can't find reference to it. Lets say i have a DataFrame with columns A and B

Re: [julia-users] Trouble with Type Parameters

2014-05-16 Thread Tomas Lycken
But do you agree that the usage of x::T as a formal parameter is quite different when T is a type parameter compared to when it is a plain type? I'm not 100% sure I grok what you're getting at, but *if *what you're asking is whether I see a difference between foo(x::Real) and

[julia-users] fill! with copies

2014-05-16 Thread Carlos Becker
Hello all, I wanted to create an array of an immutable type and initialize an empty copy in each (with the default constructor). I am wondering which is the best way to do it, so far: immutable ChannVals taus::Vector{Float64} alphas::Vector{Float64} ChannVals() = new( Float64[], Float64[] )

Re: [julia-users] fill! with copies

2014-05-16 Thread Carlos Becker
* correction, 'allVals' is 'arr' in the last line of code. -- Carlos On Fri, May 16, 2014 at 10:27 AM, Carlos Becker carlosbec...@gmail.comwrote: Hello all, I wanted to create an array of an immutable type and initialize an empty copy in each (with

Re: [julia-users] Trouble with Type Parameters

2014-05-16 Thread Mauro
Here is an example of the difference Toivo refers to (I think): julia foo{T:Real}(a::Array{T},b::T) = T foo (generic function with 1 method) julia bar(a::Array{Real},b::Real) = Real

[julia-users] NFFT Package

2014-05-16 Thread Tobias Knopp
This is just an anouncement that I have been working on a package for performing non-equidistant fast Fourier transforms (NFFT). The package should now be accessible using Pkg.add(NFFT). Some basic usage examples can be found here: https://github.com/tknopp/NFFT.jl The NFFT (also known as

Re: [julia-users] fill! with copies

2014-05-16 Thread Tim Holy
Try arr = [ChannVals() for i = 1:10] On Friday, May 16, 2014 01:27:18 AM Carlos Becker wrote: Hello all, I wanted to create an array of an immutable type and initialize an empty copy in each (with the default constructor). I am wondering which is the best way to do it, so far:

Re: [julia-users] Trouble with Type Parameters

2014-05-16 Thread Alex
Correct me if I am wrong, but IMHO the comparison of the two functions in Mauro's last post is not entirely fair for :: because the parametrized version imposed an additional constraint which has nothing to do with :: Essentially in the two cases the following types are required: foo: T :

Re: [julia-users] NFFT Package

2014-05-16 Thread Ariel Keselman
How close did you get to c speed?

[julia-users] Re: logical indexing... broadcasting

2014-05-16 Thread Abe Schneider
I might try something like (note the code code is written for clarity, not for compactness or completeness): function encode_name(name::String) if name == setosa return [1 0 2]; elseif name == versicolor return [2 1 0]; else return [0 2 1]; end end output = map(encode_name,

Re: [julia-users] NFFT Package

2014-05-16 Thread Tobias Knopp
Well, this is actually an interesting story. In my first test the code was about 100 times slower for which reason I did not investigate Julia further and concentrated on a Numpy like multidimensional array package called numcpp: https://github.com/tknopp/numcpp. And with C++11 I got actually

[julia-users] Re: Fast, robust predicates with Julia

2014-05-16 Thread Job van der Zwan
Thank you so much! I am very busy with other things at the moment, but will dive into the code, attempt to update as necessary in a few weeks and share the results, if any. On Monday, 12 May 2014 22:52:17 UTC+2, Ariel Keselman wrote: Just looked for the code in some old backup drive and

[julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Jon Norberg
Hi all, I have been using julia and ijulia for a while and everything worked fine. over time I get more and more issues, trying to upgrade/reinstall etc and now I can't get it to work at all anymore. As I intend to reinstall osx anyway, I was wondering if you good people have any good setup

[julia-users] UnionType - tuple of DataType(s)

2014-05-16 Thread Tony Fong
Hello, new user and subscriber here. Is there a way to decompose a UnionType back into its constituent type(s)? I tried names(): dt = Union(Int,Float64) names(dt) 1-element Array{Symbol,1}: :types convert() seems to hit dead-ends. Help appreciated. Tony

[julia-users] Re: UnionType - tuple of DataType(s)

2014-05-16 Thread Patrick O'Leary
On Friday, May 16, 2014 2:09:03 AM UTC-5, Tony Fong wrote: Hello, new user and subscriber here. Is there a way to decompose a UnionType back into its constituent type(s)? I tried names(): dt = Union(Int,Float64) names(dt) 1-element Array{Symbol,1}: :types convert() seems to hit

Re: [julia-users] UnionType - tuple of DataType(s)

2014-05-16 Thread Mauro
the `names` function is indeed the right way to go about it: julia un = Union(Int, Float64) Union(Int64,Float64) julia names(un) 1-element Array{Symbol,1}: :types julia un.types (Int64,Float64) julia un.types[1] Int64 julia un.types[2] Float64 For datatypes: julia type A a::Int

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Cameron McBride
I am not sure if this appeals to you, but I'm happy to share my configuration. I just use the REPL and a decent editor (vim), which I'm happy with. I've been using this setup for the past couple months (mid-March). I've only had occasionally issues, but I follow HEAD so that is expected. I am

[julia-users] Problems with the scheduling example in the docs

2014-05-16 Thread St Elmo Wilken
Hi, I'm struggling to understand the scheduling subsection (in the parallel computation section) of the docs; specifically how the pmap function as shown there works. I've copy-pasted the code I used below my questions. Question 1) Is the purpose of the @sync block just to wait for all the

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Adrian Cuthbertson
I follow an identical process to Cameron, with the same results. - Adrian. On Fri, May 16, 2014 at 3:37 PM, Cameron McBride cameron.mcbr...@gmail.comwrote: I am not sure if this appeals to you, but I'm happy to share my configuration. I just use the REPL and a decent editor (vim), which I'm

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Ethan Anderes
+1 for Cameron. I use the same workflow.

[julia-users] Inconsistent dictionary behaviour

2014-05-16 Thread Andrew B. Martin
Hey guys, I'm confused by this dictionary behaviour. I create a dictionary like this: for line=readlines(open(string(directo, 4_column_file.tab)))[2:end] tmp = split(line, '\t') ste_data[(tmp[1], tmp[2], tmp[3])] = tmp[4] end Then I run v = collect(keys(ste_data)) to get an array

Re: [julia-users] Re: Inconsistent dictionary behaviour

2014-05-16 Thread Stefan Karpinski
We really need to make that work the same way – can you open an issue? On Fri, May 16, 2014 at 10:42 AM, Andrew B. Martin andrew.brown.mar...@gmail.com wrote: Found the problem. The indices are tuples of substrings and I'm querying using strings.

[julia-users] Re: Inconsistent dictionary behaviour

2014-05-16 Thread Andrew B. Martin
Should this be mentioned in the documentation? Currently it reads that split returns an array of strings, but I'm finding that it returns an array of SubStrings.

Re: [julia-users] fill! with copies

2014-05-16 Thread Jameson Nash
Since they are immutable, fill! did exactly what you wanted On Friday, May 16, 2014, Tim Holy tim.h...@gmail.com wrote: Try arr = [ChannVals() for i = 1:10] On Friday, May 16, 2014 01:27:18 AM Carlos Becker wrote: Hello all, I wanted to create an array of an immutable type and

Re: [julia-users] Re: Inconsistent dictionary behaviour

2014-05-16 Thread Stefan Karpinski
Well, SubStrings are Strings. The issue here is that we're hashing tuples based on their type, which is problematic. We very much need to (re)think how collection hashing works. The basic question is whether containers should hash differently based on their type, their eltype, or just their

Re: [julia-users] Re: Inconsistent dictionary behaviour

2014-05-16 Thread Andrew B. Martin
Issue filed: https://github.com/JuliaLang/julia/issues/6870 I'm new to filing issues on github, so please feel free to clarify if I'm not expressing the problem well.

Re: [julia-users] Re: Inconsistent dictionary behaviour

2014-05-16 Thread Stefan Karpinski
No, that's perfect. Thanks! On Fri, May 16, 2014 at 11:14 AM, Andrew B. Martin andrew.brown.mar...@gmail.com wrote: Issue filed: https://github.com/JuliaLang/julia/issues/6870 I'm new to filing issues on github, so please feel free to clarify if I'm not expressing the problem well.

[julia-users] Indexing DataFrames

2014-05-16 Thread Jason Solack
Hello all I'm trying to index a dataframe in the folowing manner: df = DataFrame(A = round(rand(1000) * 10), B = round(rand(1000) * 10)) df[:C] = 0 df[(df[:A] .== 1 df[:B] .== 1),: C] = 1 I get an error ERROR: no method (Int64, DataArray{Float64, 1}) if i index like this, it works but i

Re: [julia-users] Indexing DataFrames

2014-05-16 Thread John Myles White
This is a result of the weird precedence of . Try this: (df[:A] .== 1) (df[:B] .== 1) — John On May 16, 2014, at 8:25 AM, Jason Solack jaysol...@gmail.com wrote: Hello all I'm trying to index a dataframe in the folowing manner: df = DataFrame(A = round(rand(1000) * 10), B =

Re: [julia-users] Indexing DataFrames

2014-05-16 Thread Jason Solack
perfect, thank you! On Friday, May 16, 2014 11:28:46 AM UTC-4, John Myles White wrote: This is a result of the weird precedence of . Try this: (df[:A] .== 1) (df[:B] .== 1) — John On May 16, 2014, at 8:25 AM, Jason Solack jays...@gmail.com javascript: wrote: Hello all I'm

Re: [julia-users] Trouble with Type Parameters

2014-05-16 Thread Toivo Henningsson
Yes, that is exactly the kind of example that I'm referring to. (As is the example that started this thread as well.) In all other cases, x::T is covariant in the sense that it allows typeof(x) : T. But in an argument list when T is a type parameter to the same method, x::T is instead invariant

Re: [julia-users] for loops

2014-05-16 Thread Stefan Karpinski
That form of iteration is common from Ruby, which is where I'm guessing this interest is coming from? Ruby has the block/proc/lambda distinction that makes the for loop and .each forms behaviorally similar, whereas in Julia, there's just the one kind of anonymous function. As a result, if this

[julia-users] Re: JuliaCon Question Thread

2014-05-16 Thread G. Patrick Mauroy
I think it is great to have most topics advanced, it is a fun and educational way to engage with contributors and see all the power of the language in action. However if one of the objectives of the conference is also to broaden a bit the audience -- e.g., spark the interest of a few more

[julia-users] how to Replicate array, translate from matlab

2014-05-16 Thread paul analyst
in matlab : x=[1,4] B=repmat(A,x) /(B==) how to replicate A in Julia Paul

[julia-users] Re: how to Replicate array, translate from matlab

2014-05-16 Thread Jason Merrill
Julia has repmat. You can look up its methods like this: julia methods(repmat) # 3 methods for generic function repmat: repmat(a::AbstractArray{T,1},m::Int64) at abstractarray.jl:964 repmat(a::Union(AbstractArray{T,2},AbstractArray{T,1}),m::Int64) at abstractarray.jl:950

[julia-users] Re: how to Replicate array, translate from matlab

2014-05-16 Thread Gabor
B=repmat(A,x...) On Friday, May 16, 2014 8:18:14 PM UTC+2, paul analyst wrote: in matlab : x=[1,4] B=repmat(A,x) /(B==) how to replicate A in Julia Paul

[julia-users] Re: JuliaCon Question Thread

2014-05-16 Thread Job van der Zwan
Are you going to film/livestream it? Are you going to have lightning talks? If the answer to both questions is yes, don't forget to film/stream the latter! Apparently the GopherCon last month had some amazing lightning talks but nobody remembered to film them. On Tuesday, 13 May 2014 05:43:34

Re: [julia-users] Trouble with Type Parameters

2014-05-16 Thread Mauro
On Fri, 2014-05-16 at 17:18, Toivo wrote: Yes, that is exactly the kind of example that I'm referring to. (As is the example that started this thread as well.) Haha, well sometimes I just take a bit longer to figure things out... ;-) I suspect that the pragmatic rule that Julia follows is

Re: [julia-users] Re: JuliaCon Question Thread

2014-05-16 Thread Stefan Karpinski
We're going to film but not live stream. We'll film the lightning talks too – good to have a reminder. On Fri, May 16, 2014 at 3:50 PM, Job van der Zwan j.l.vanderz...@gmail.comwrote: Are you going to film/livestream it? Are you going to have lightning talks? If the answer to both questions

[julia-users] Design patterns for an API

2014-05-16 Thread francois . fayard
Hi, I am starting to use Julia, and I would like to learn and contribute a bit. As I have some experience in numerics I am thinking of contributing to the ODE package. I've read the ideas for the API, and I believe that we can still improve it. Usually, for this kind of solver, we could

Re: [julia-users] Natural language processing in Julia

2014-05-16 Thread Jonathan Malmaud
Hi Sorami, Yes, JuliaText is meant to be the repository of Julia NLP packages and I agree with you about Julia's potential in the NLP domain. There hasn't been a lot of action there since I think there aren't many people using Julia for NLP yet (although I hope that changes). Any contributions

Re: [julia-users] fill! with copies

2014-05-16 Thread Ivar Nesje
@Jameson They are immutable, but they contain references to mutable arrays, and all the immutable types will reference the same arrays. That way you would not just need a copy but a deepcopy. That will probably be too much overhead for fill!(), and will be problematic if someone decided to

[julia-users] Execution order of nested iterations in comprehensions vs for loops

2014-05-16 Thread Peter Simon
Comprehensions and for loops do not perform nested looping in the same order: julia [begin println((i,j)); (i,j) end for i = 1:3, j = 1:4] (1,1) (2,1) (3,1) (1,2) (2,2) (3,2) (1,3) (2,3) (3,3) (1,4) (2,4) (3,4) 3x4 Array{(Int64,Int64),2}: (1,1) (1,2) (1,3) (1,4) (2,1) (2,2) (2,3) (2,4)

Re: [julia-users] Re: Execution order of nested iterations in comprehensions vs for loops

2014-05-16 Thread Stefan Karpinski
It's less about the array ordering and more about the fact that mathematically the row index comes before the column index and doing it the other way would be very confusing. It's a shame these don't match, but there's not much to do about it. On May 16, 2014, at 4:57 PM,

[julia-users] Re: Design patterns for an API

2014-05-16 Thread francois . fayard
I am new to GitHub. Is there some kind of forum, or do you mean to create a new file with my thoughts on it ? On Friday, May 16, 2014 11:26:21 PM UTC+2, Alex wrote: so if you have a github account it might be good to post your thoughts there as well.