Skip to content

Timestamp.dayofyear method returns day of month. #2021

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

Closed
eheisman opened this issue Oct 4, 2012 · 2 comments
Closed

Timestamp.dayofyear method returns day of month. #2021

eheisman opened this issue Oct 4, 2012 · 2 comments
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@eheisman
Copy link

eheisman commented Oct 4, 2012

I noticed this while doing some work where I'm filtering values based on day of year: The dayofyear method of the Timestamp class returns the day of the month, not the day of the year. I realize there are a number of ways to compute this, none of which is very fast, but it could be changed to return the difference, in days, between it's own value and 0000 01 January of the current year.

In pandas/src/datetime.pyx, the problematic code is, starting on line 147/148, in the definition of the function.

@wesm
Copy link
Member

wesm commented Oct 4, 2012

Thanks! We'll get it fixed for the release

@changhiskhan
Copy link
Contributor

changed "return self.day" to "return self._get_field('doy')"

@wesm wesm closed this as completed Oct 5, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Nov 15, 2012
Version 0.9.0

* tag 'v0.9.0': (43 commits)
  RLS: Version 0.9.0 final
  Fix groupby.median documentation
  BUG: need extra slash on windows for file://
  BUG: default pandas.io.data start date 1/1/2000 per docs. close pandas-dev#2011
  clean up tests
  Allow DataFrame.update to accept non DataFrame object and attempt to coerce.
  ENH: Use given name for DataFrame column name for FRED API
  BLD: quiet tox warning about missing dep
  BUG: reset_index fails with MultiIndex in columns pandas-dev#2017
  BUG: with_statement in test_console_encode() (3a11f00) broke 2.5 test suite
  BUG: dict comprehension in (af3e13c) broke 2.6 test suite
  BUG: Timestamp dayofyear returns day of month pandas-dev#2021
  BUG: pandas breaks mpl plot_date
  DOC: update parsers header, names args doc
  BUG: read_csv regression, moved date parsing to before type conversions now so can parse yymmdd hhmm format now pandas-dev#1905
  Fix naming of ewmvar and ewmstd in documentation
  DOC: whats new for pandas-dev#2000
  ENH: change default header names in read_* functions from X.1, X.2, ... to X0, X1, ... close pandas-dev#2000
  TST: make test suite pass cleanly on python 3 with no matplotlib
  BUG: datetime64 formatting issues in DataFrame.to_csv. close pandas-dev#1993
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

No branches or pull requests

3 participants