-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Incosistent handling of null types by PeriodIndex #46673
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
Labels
Comments
take |
Feel free to ask should you need any further information on this report. Thank you. |
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 18, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 18, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 18, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 18, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 18, 2022
5 tasks
mroeschke
pushed a commit
that referenced
this issue
Jul 18, 2022
…46409) (#47736) * TST: add test for last method on dataframe grouped by on boolean column (#46409) * TST: add test for last method on dataframe grouped by on boolean column (#46409) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673)
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 22, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 22, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 22, 2022
kapiliyer
added a commit
to kapiliyer/pandas
that referenced
this issue
Jul 25, 2022
mroeschke
pushed a commit
that referenced
this issue
Aug 1, 2022
…lace (#46673) (#47780) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: Series.astype is unable to handle pd.nan. * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: Series.astype is unable to handle pd.nan (#46377) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673) * BUG: PeriodIndex fails to handle NA, rather than putting NaT in its place (#46673)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
The constructor of PeriodIndex correctly handles
None
andnp.nan
values in the input data, but fails to handlepd.NA
values. Given that the latter is automatically introduced into a Series of which is calledastype('string')
, this poses a serious limitation to the initalization of PeriodIndex objects from a Series of dtypestring
.Expected Behavior
The return value of
pd.PeriodIndex(["2022-04-06", "2022-04-07", pd.NA], freq='D')
should be the same as
pd.PeriodIndex(["2022-04-06", "2022-04-07", None], freq='D')
that is:
PeriodIndex(['2022-04-06', '2022-04-07', 'NaT'], dtype='period[D]')
Installed Versions
The text was updated successfully, but these errors were encountered: