Re: [julia-users] Indexing a large matrix is MUCH slower (~ 150x) slower in 0.5 (and 0.6) than 0.4.7

2016-10-31 Thread Ian Butterworth
Yu wrote: > > On Mon, Oct 31, 2016 at 6:34 PM, Ian Butterworth > <i.r.but...@gmail.com > wrote: > > I'm not sure of the etiquette, but I'm cross-posting this from > stackoverflow > > as it seems like quite a significant issue... > > > > As an e

[julia-users] Indexing a large matrix is MUCH slower (~ 150x) slower in 0.5 (and 0.6) than 0.4.7

2016-10-31 Thread Ian Butterworth
I'm not sure of the etiquette, but I'm cross-posting this from stackoverflow as it seems like quite a significant issue... As an example: x = rand(10,10,100,4,4,1000) #Dummy array tic() r = squeeze(mean(x[:,:,1:80,:,:,56:800],(1,2,3,4,5)),(1,2,3,4,5)) toc() Julia 0.5.0 -> elapsed time:

[julia-users] Convert datetime string that has AM/PM to datetime, without using Calendar.jl

2015-09-08 Thread Ian Butterworth
I current use Calendar.jl to convert a datetime that contains AM/PM to the datetime type like this: datetime_string = "2015-08-12 12:01:23 PM" timeout = unix2datetime(Calendar.parse(datetime_string, timein).millis/1000) I'd like to do it without calendar.jl if possible. Any ideas?

[julia-users] Re: Convert datetime string that has AM/PM to datetime, without using Calendar.jl

2015-09-08 Thread Ian Butterworth
Sorry, error in example. Should read: datetime_string = "2015-08-12 12:01:23 PM" timeout = unix2datetime(Calendar.parse("-MM-dd hh:mm:ss aa", datetime_string).millis/1000) On Tuesday, 8 September 2015 17:27:25 UTC-4, Ian Butterworth wrote: > > I current

Re: [julia-users] Re: Convert datetime string that has AM/PM to datetime, without using Calendar.jl

2015-09-08 Thread Ian Butterworth
Thanks for the tip, although I'm getting an error with your code in 0.4.0-dev Any idea why? using Base.Dates ds = "2015-08-12 12:01:23 PM" DateTime(ds, DateFormat("-mm-dd HH:MM:SS")) - (contains(ds, "AM") ? Hour (12) : Hour(0)) LoadError: ArgumentError: Non-digit character encountered

Re: [julia-users] Re: Convert datetime string that has AM/PM to datetime, without using Calendar.jl

2015-09-08 Thread Ian Butterworth
Ok. I'm running 0.4.0-dev on juliabox I managed to make it work by removing the last 3 characters from the input string, and using single format characters. Also caught a bug that occurs when the hour in the string = 12, and it's PM. I believe that hour was incorrectly being shifted.. but

[julia-users] Today either 'get' started returning erroneously formatted data ...OR... JSON.parse changed behaviour [in 0.3.11 on Juliabox]

2015-08-28 Thread Ian Butterworth
Today I started getting an error on juliabox that only occurs in 0.3.11. I posted this to the 'Requests' github, but I thought it may not actually be the source of the issue. Can anyone shed any light? If you run this: resp = get(http://httpbin.org/get;) object =

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-15 Thread Ian Butterworth
Thanks guys. I ended up using Kaj's approach. Functionality like we discussed would be good if possible. On Saturday, 15 August 2015 06:16:09 UTC-4, Jeffrey Sarnoff wrote: What would like two lines of code to do with durations? On Friday, August 14, 2015 at 7:41:04 PM UTC-4, Ian Butterworth

[julia-users] Re: Possible to use filter! on a child dict within a parent dict, to remove the entire parent dict if condition in child is met?

2015-08-14 Thread Ian Butterworth
) A = 3 On Friday, August 14, 2015 at 12:07:28 PM UTC-4, Ian Butterworth wrote: I have a dict containing both key+value pairs, and key+[array of dict] pairs. Can I use filter! to remove the entire parent dict if condition in child is met? i.e. If measurements[uniqueentrykey][studyid

[julia-users] Get time between two DateTime values in hours (and minutes if simple)

2015-08-14 Thread Ian Butterworth
Trying to get the number of hours between these two dates (ideally x hours and y minutes), but can't figure out how to convert the duration variable into hours. The bottom line currently errors timein = 2015/8/13 10:19:50 timein2 = 2015/8/14 13:12:34 time_series[1] = DateTime(timein,/mm/dd

[julia-users] Re: Get time between two DateTime values in hours (and minutes if simple)

2015-08-14 Thread Ian Butterworth
like this: Dates.Hour(time_series[2]) - Dates.Hour(time_series[1]) Here's to a Good Evening On Friday, August 14, 2015 at 7:41:04 PM UTC-4, Ian Butterworth wrote: Trying to get the number of hours between these two dates (ideally x hours and y minutes), but can't figure out how

[julia-users] Possible to use filter! on a child dict within a parent dict, to remove the entire parent dict if condition in child is met?

2015-08-14 Thread Ian Butterworth
I have a dict containing both key+value pairs, and key+[array of dict] pairs. Can I use filter! to remove the entire parent dict if condition in child is met? i.e. If measurements[uniqueentrykey][studyid] == bad study then remove measurements[uniqueentrykey] Thanks

[julia-users] Add a new dict with 2 different types into a new array in a structured dict

2015-08-10 Thread Ian Butterworth
How can I add a dict with 2 different field types (1D array of float and float) to an array nested in a dict that already exists? The 'allmeas' structure already exists up to this point: allmeas[measkey][manreps][num_manrep] And I'm trying to add like this: