Skip to content

BUG: unstack with nulls & Timedelta/DateTime index #9491

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
Feb 16, 2015

Conversation

behzadnouri
Copy link
Contributor

xref #9292 (comment)

on branch:

>>> df
           a       b    c
0 2014-02-01 -1 days  100
1        NaT     NaT  101
2 2014-02-03  1 days  102
3        NaT  2 days  103
4 2014-02-05     NaT  104
5 2014-02-06  4 days  105

>>> df.pivot('a', 'b', 'c').fillna('-')
b           NaT -1 days 1 days 2 days 4 days
a
NaT         101       -      -    103      -
2014-02-01    -     100      -      -      -
2014-02-03    -       -    102      -      -
2014-02-05  104       -      -      -      -
2014-02-06    -       -      -      -    105

>>> df.pivot('b', 'a', 'c').fillna('-')
a        NaT 2014-02-01 2014-02-03 2014-02-05 2014-02-06
b
NaT      101          -          -        104          -
-1 days    -        100          -          -          -
1 days     -          -        102          -          -
2 days   103          -          -          -          -
4 days     -          -          -          -        105

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Feb 15, 2015
@jreback jreback added this to the 0.16.0 milestone Feb 15, 2015
@jreback
Copy link
Contributor

jreback commented Feb 15, 2015

  • can you add a release note
  • pls make the test on a mixed frame e.g. with ints/datetimes/timedeltas in it (with datetimes/timedeltas) have NaT's. for a full test

@behzadnouri
Copy link
Contributor Author

what do u mean? the added test is already a mixed frame with ints, datetimes & timedelta

@jreback
Copy link
Contributor

jreback commented Feb 16, 2015

sorry, was looking at some things else....ok just the release note and good to go (and put a comment on the test that refers to issue as well)

@behzadnouri
Copy link
Contributor Author

added the release note

jreback added a commit that referenced this pull request Feb 16, 2015
BUG: unstack with nulls & Timedelta/DateTime index
@jreback jreback merged commit fc88ab9 into pandas-dev:master Feb 16, 2015
@jreback
Copy link
Contributor

jreback commented Feb 16, 2015

@behzadnouri thanks as always!

@behzadnouri behzadnouri deleted the idx-insert-nan branch March 6, 2015 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants