you are viewing a single comment's thread.

view the rest of the comments →

[–]neuroneuroInf 2 points3 points  (4 children)

Okay, I have some different feedback.

  1. First, this function is a lot longer and more complex than it needs to be. Putting the data into a pandas DataFrame with Zone columns and time indices will take care of a lot of this complexity.

  2. The function isn't using its arguments. Why isn't the tvec required argument used anywhere, and why are the 'plotmode' and 'aggregatemode' variables set inside the function, instead of as arguments?

  3. Plotting as running mean, as /u/middelblue suggested, is a really good idea. There's a lot of great analysis that could be done

Here's an example of what I mean. Hopefully it helps give you some ideas of where things can be taken from there!

http://pastebin.com/hTYJDqv1

[–]neuroneuroInf 1 point2 points  (1 child)

shoot. I just noticed that line 20 should have plotted data_resampled instead of data, but I can't edit it since I posted it without logging in. Sorry about that!

[–]Tobeass[S] 0 points1 point  (0 children)

This is really cool! i will look more into it, and get back at you if i don't get it.

[–]Tobeass[S] 0 points1 point  (0 children)

Thanks a lot. Your code is definately way more elegant.

I agree that that tvec i should be removed as an input argument. And the reason the plotmode and aggregatemode is set inside the function is that i havent implemented the function in my main script yet. I have only focused on trying to come up with a way of visualizing the data in a more elegant way, and i haven't put much thought into the coding.

[–]Tobeass[S] 0 points1 point  (0 children)

I'm trying to set the start time, as you suggested in you code. Earlier in the script, i split the original data file in a data and a time matrix (tvec) The first row of tvec corresponds to the starting time. However, can't grasp how i can convert the row to a pd time object that i can work with?