Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected version of ts_hourly #2183

Closed
wants to merge 6 commits into from
Closed

corrected version of ts_hourly #2183

wants to merge 6 commits into from

Conversation

timmie
Copy link
Contributor

@timmie timmie commented Nov 5, 2012

small glitch in the function but mainly fixes in tests

@timmie timmie mentioned this pull request Nov 5, 2012
@wesm
Copy link
Member

wesm commented Nov 6, 2012

BTW no need to create a new PR, you can just keep pushing commits to the branch you're working on

@changhiskhan
Copy link
Contributor

@timmie, I implemented an hourly version in pivot_annual, pivot_annual and pivot_annual_h were so similar that it didn't make sense to have separate method and module just to have output in a different orientation. You can always use .T on the output.

I didn't merge in the extended_info and the default index. Here's why:

  1. default index: having the wrong year is not the right way to do this. I guess you need it to access month/week/day properties. In that case you should make a function that can take a year and an array/index of ints that represents hours and create a correct datetimeindex.
  2. extended info: would DataFrame.describe be enough?

I'm moving the rest of this issue to 0.11 if you still want to finish the 2 items I just listed above.

@timmie
Copy link
Contributor Author

timmie commented Nov 23, 2012

I implemented an hourly version in pivot_annual, pivot_annual and pivot_annual_h were so similar that it didn't

Thank you very much for that! Shall we add a similar part for minutely?

it didn't make sense to have separate method and module just to have output in a different orientation. You can always use .T on the output.

In earlier version I had problems with .T. And I flet that format easier to read.

default index: having the wrong year is not the right way to do this. I guess you need it to access month/week/day properties.

Exactly.

In that case you should make a function that can take a year and an array/index of ints that represents hours and create a correct datetimeindex.

Could you please show me an example? Python datetime always needs a year/month/day/hour.

extended info: would DataFrame.describe be enough?

well, I do not think so:

describe?
Generate various summary statistics of each column

So this is like the summary of a column.

extended info would generate the descriptives for all columns and add it to the dataframe

I.e. create long-term hourly averages.

Or would you do this also with DataFrame.describe?

Thanks again!

@wesm
Copy link
Member

wesm commented Dec 2, 2012

Is there anything remaining here or can be closed?

@changhiskhan
Copy link
Contributor

@timmie, you can probably just do df.T.describe() to get most of what you want.

  • minutely: sure, go ahead and just piggieback off of my code for that
  • default index: maybe another way to do this is to generate the field info BEFORE you do the pivoting?
  • datetime fields in extended info: I think maybe the right place for that is to make a method DatetimeIndex.fields that returns a DataFrame whose columns are the field names. This method should optionally take a list of field names.

I'm going to close this PR. Please make a new PR with the stuff mentioned above if you're interested.
As always, thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants