Skip to content

TST: Add test_factorize_mixed_values #50784

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

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

luke396
Copy link
Contributor

@luke396 luke396 commented Jan 17, 2023

It has mentioned some different values for factorize. This is the list:

pd.factorize(pd.Categorical(['a', 'a', 'c']))
pd.factorize(pd.Index(pd.Categorical(['a', 'a', 'b'])))
pd.factorize(pd.Series(pd.DatetimeIndex(['2017', '2017'], tz='US/Eastern')))
pd.factorize(pd.Series(pd.Categorical(['a', 'a', 'b'])))

For pd.factorize(pd.Categorical(['a', 'a', 'c'])), it has been test via REF/BUG/API: factorizing categorical data in pandas/tests/categorical/test_algos.py.

The rest are added here.

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Categorical Categorical Data Type labels Jan 17, 2023
@mroeschke mroeschke added this to the 2.0 milestone Jan 17, 2023
@mroeschke mroeschke merged commit 8d296f2 into pandas-dev:main Jan 17, 2023
@mroeschke
Copy link
Member

Thanks @luke396! Happy to see these unit testing issues getting addressed

@luke396 luke396 deleted the add_test_factorize_mixed_values branch January 18, 2023 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Categorical Categorical Data Type Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: Should factorize(categorical) return a Categorical for uniques?
2 participants