Skip to content

Preserve dtype on reset_index() in an empty DataFrame #23856

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
wants to merge 1 commit into from
Closed

Preserve dtype on reset_index() in an empty DataFrame #23856

wants to merge 1 commit into from

Conversation

vaibhawc
Copy link

@pep8speaks
Copy link

Hello @vaibhawc! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #23856 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23856   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files         161      161           
  Lines       51500    51500           
=======================================
  Hits        47528    47528           
  Misses       3972     3972
Flag Coverage Δ
#multiple 90.68% <100%> (ø) ⬆️
#single 42.31% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/frame.py 97.02% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20ae454...98629b2. Read the comment docs.

@datapythonista
Copy link
Member

Thanks for the contribution @vaibhawc can you add unit tests and a whatsnew note on what is being fixed?

@datapythonista datapythonista changed the title ISSUE NO. #19602 Preserve dtype on reset_index() in an empty DataFrame Nov 22, 2018
@datapythonista datapythonista added Indexing Related to indexing on series/frames, not to indexes themselves Dtype Conversions Unexpected or buggy dtype conversions labels Nov 22, 2018
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs tests

@datapythonista
Copy link
Member

Closing as stale, @vaibhawc if you want to continue working on it, please address comments and reopen the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reset_index() on MultiIndexed empty dataframe does not preserve dtypes
4 participants