[julia-users] Re: What is @d?

2015-12-24 Thread Ismael Venegas Castelló
Erick If you've found out by now what that macro does, you could send a PR with a docstring for it! Something like: "Creates a typed dictionary." macro d(xs...) @cond if VERSION < v"0.4-" Expr(:typed_dict, :(Any=>Any), map(esc, xs)...) else :(Dict{Any, Any}($(map(x->esc(prockey(x)),

Re: [julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Yichao Yu
On Thu, Dec 24, 2015 at 8:22 PM, Yichao Yu wrote: > On Thu, Dec 24, 2015 at 7:51 PM, Ismael Venegas Castelló > wrote: >> Something like this: >> >> julia> df = DataFrame(x = Int[1:10; typemax(Int8)]); >> >> julia> eltype(df[:x]) >> Int64 >> >> julia>

[julia-users] Re: What's in your .juliarc.jl file?

2015-12-24 Thread Daniel Carrera
I use it to load SIUnits and a module that I wrote with a bunch of astronomical constants (e.g. masses and orbits of all the planets). On Wednesday, 23 December 2015 21:38:44 UTC+1, SundaraRaman R wrote: > > I'm a newbie to Julia and just today learnt that there's a .juliarc.jl > initialization

[julia-users] Re: Getting the last match for a regular expression in a string

2015-12-24 Thread Ismael Venegas Castelló
Where s is: julia> s = "1.ts, 2.ts, , 00xyz.ts" "1.ts, 2.ts, , 00xyz.ts" El jueves, 24 de diciembre de 2015, 18:57:05 (UTC-6), Ismael Venegas Castelló escribió: > > Is something like this what you are looking for? > > julia> matchall(r"(\d+?.+?\.ts)", s) > 3-element

[julia-users] Re: Getting the last match for a regular expression in a string

2015-12-24 Thread Ismael Venegas Castelló
Is something like this what you are looking for? julia> matchall(r"(\d+?.+?\.ts)", s) 3-element Array{SubString{UTF8String},1}: "1.ts" "2.ts" "00xyz.ts" El jueves, 24 de diciembre de 2015, 12:30:52 (UTC-6), Douglas Bates escribió: > > Short version: > > I have a string that

[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Ismael Venegas Castelló
Yichao, why is it bad idea to splat? Is it not performant? El jueves, 24 de diciembre de 2015, 5:02:14 (UTC-6), Min-Woong Sohn escribió: > > I want to reduce the amount of memory used by a dataframe that has lots of > binary variables. What is the best way to achieve this? For example, how >

[julia-users] Re: Getting the last match for a regular expression in a string

2015-12-24 Thread Steven G. Johnson
You can reverse(the string), then use a reversed regex pattern, then use the reverseind function to transform the indices of the matches back to indices in the original string.

[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Min-Woong Sohn
df[:x] = Int8[df[:x]...] doesn't seem to work with NAs. On Thursday, December 24, 2015 at 6:02:14 AM UTC-5, Min-Woong Sohn wrote: > > I want to reduce the amount of memory used by a dataframe that has lots of > binary variables. What is the best way to achieve this? For example, how > can I

[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Ismael Venegas Castelló
Something like this: julia> df = DataFrame(x = Int[1:10; typemax(Int8)]); julia> eltype(df[:x]) Int64 julia> df[:x] = Int8[df[:x]...]; julia> eltype(df[:x]) Int8 julia> df = DataFrame(x = Int[1:10; typemax(Int8) + 1]); julia> eltype(df[:x]) Int64 julia> df[:x] = Int8[df[:x]...]; ERROR:

Re: [julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Yichao Yu
On Thu, Dec 24, 2015 at 7:51 PM, Ismael Venegas Castelló wrote: > Something like this: > > julia> df = DataFrame(x = Int[1:10; typemax(Int8)]); > > julia> eltype(df[:x]) > Int64 > > julia> df[:x] = Int8[df[:x]...]; > > julia> eltype(df[:x]) > Int8 > > julia> df =

[julia-users] Variable and value labels in DataFrames

2015-12-24 Thread Min-Woong Sohn
Is there a way to attach variable and value labels in a DataFrame?

[julia-users] Imitating scanf

2015-12-24 Thread Steven White
Say I have a data file in plain text, which starts with some lines that describe matrix sizes, etc, for the data that follows. For example, the first line might be 9 2 2 1.3 To read this file, in C I would use something like this call to scanf: scanf("%d%d%d%lf"); How do I do this in

[julia-users] Do I need to pay for Juliabox?

2015-12-24 Thread Yao Lu
If I want to do parrallel computing, how could I pay to get it?

Re: [julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Yichao Yu
On Thu, Dec 24, 2015 at 8:48 PM, Ismael Venegas Castelló wrote: > Yichao, why is it bad idea to splat? Is it not performant? Yes, it's terrible for performance ``` julia> using Benchmarks julia> f1(x) = Int8[x...] f1 (generic function with 1 method) julia> f2(x) =

[julia-users] Re: Different result in pmap vs remotecall

2015-12-24 Thread Daniel Arndt
Sorry for the delayed response, I didn't notice the push! sorry! Glad you figured it out though. On Tuesday, 22 December 2015 12:18:10 UTC-5, lmaga...@soasta.com wrote: > > Of course if I don't do *@everywhere push!(...)* then I get a > BoundsError... > > Well, that was entirely my fault.

Re: [julia-users] Re: What's in your .juliarc.jl file?

2015-12-24 Thread SundaraRaman R
On Thursday, December 24, 2015 at 8:48:36 AM UTC+5:30, Stefan Karpinski wrote: > > Mine's empty. I just take anything I want in .juliarc.jl and put it > directly in base. j/k > Haha, I actually thought about something related when posting the question: there's a lot of common boilerplate in

[julia-users] Getting the last match for a regular expression in a string

2015-12-24 Thread Douglas Bates
Short version: I have a string that contains several instances of names of the form 1.ts, 2.ts, , 00xyz.ts and I want to find the last match. That is, I want to find "00xyz.ts" or, alternatively, find all such names in sequence.. Longer version: These are file names of a series

Re: [julia-users] What is @d?

2015-12-24 Thread Stefan Karpinski
Totally agree – one-letter macro names aren't the best form. On Wed, Dec 23, 2015 at 11:43 PM, Tony Kelman wrote: > May be grep-able, but doesn't change the point that a single letter macro > name is not the greatest for readability.

Re: [julia-users] Moore foundation grant.

2015-12-24 Thread Viral Shah
What would be helpful is to know what kind of decisions you are thinking of and what are the factors. I suspect within 2 weeks for sure - but it's really for the Julia stats folks to say. The idea is to get feedback and chart a course. -viral On 24 Dec 2015 10:07 p.m., "Lampkld"

[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Min-Woong Sohn
An error message would be nice. On Thursday, December 24, 2015 at 6:37:41 AM UTC-5, Tony Kelman wrote: > > Do you want an error, or truncation, or wraparound for values that are too > large to fit in an Int8?

Re: [julia-users] Moore foundation grant.

2015-12-24 Thread Lampkld
Sorry to bug you, but can we expect something this or next week? Would be helpful in knowing until when to push some stuff off. On Thursday, December 17, 2015 at 6:20:45 PM UTC-5, Viral Shah wrote: > > > The JuliaStats team will be publishing a general plan on stats+df in a few > days. I

[julia-users] What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Min-Woong Sohn
I want to reduce the amount of memory used by a dataframe that has lots of binary variables. What is the best way to achieve this? For example, how can I convert a variable from Int64 to Int8 in a dataframe. Thanks

[julia-users] What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Tony Kelman
Do you want an error, or truncation, or wraparound for values that are too large to fit in an Int8?

Re: [julia-users] A trivial multiplication and Julia is giving wrong output. Why ?

2015-12-24 Thread Ümit Özden
Dear Stuart. Thanks for your help On Wednesday, December 23, 2015 at 11:02:18 PM UTC+2, Stuart Brorson wrote: > > Julia is assuming your inputs are 32 bit integers. The result of > multiplying them is larger than 2^32-1. Therefore, the integer > multiplication is performed modulo 2^32, which

Re: [julia-users] What is @d?

2015-12-24 Thread J Luis
https://www.mythicsoft.com/agentransack You won't have grepping problems again. quinta-feira, 24 de Dezembro de 2015 às 05:41:05 UTC, Eric Forgy escreveu: > > Cool! Thanks Greg. I am also using Atom and happy to learn new tricks :) > > On Thursday, December 24, 2015 at 1:33:04 PM UTC+8, Greg

[julia-users] Re: How to organise (float) data in Julia?

2015-12-24 Thread Cedric St-Jean
I too am interested in this. It might be worth building a "GrowableArray" type for d>1. In the meantime, you can check out DataFrames, they do allow growing. IIRC they are built as a vector of vector, so you should get similar performance, but the syntax is nice if you have names for your