-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API/BUG: freq retention in value_counts #33830
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
Comments
Looks like all but the
|
Hi! I would like to solve this issue. |
take |
… was preserving DateTimeIndex freq attribute
@mroeschke, I noticed that tests were made for freq retention in DatetimeIndex factorize and MutliIndex (PR #38120). I was able to make a test case for Categorical, however I wasn't sure if a test case for value_counts was needed yet as it looks like it is still not preserving freq. Should I include it? |
Feel free to skip a test for value_counts unless you'd like to also fix the bug |
…egorical was preserving DateTimeIndex freq attribute" This reverts commit e4b8cbf.
…46779) * Added test for github issue #33830 to test that categorical was preserving DateTimeIndex freq attribute * Added an additional test for value_counts preserving frequency * Modified tests in test_constructors.py to pass the pre-commit check * Removed tests from test_constructors that were not needed * Moved categorical freq retention test to pandas/tests/arrays/categorical/ Co-authored-by: Brian Gollop <[email protected]>
…andas-dev#46779) * Added test for github issue pandas-dev#33830 to test that categorical was preserving DateTimeIndex freq attribute * Added an additional test for value_counts preserving frequency * Modified tests in test_constructors.py to pass the pre-commit check * Removed tests from test_constructors that were not needed * Moved categorical freq retention test to pandas/tests/arrays/categorical/ Co-authored-by: Brian Gollop <[email protected]>
There is a comment in tests.indexes.datetimes.test_datetime
test_factorize
suggesting that freq should be preserved by factorize, but that is not checked and would fail if it wereSo the question: do we want to try to preserve freq in factorize?
xref #33677 for the MultiIndex case
Update One more: Categorical:
The text was updated successfully, but these errors were encountered: