Skip to content

Conversation

@sinhrks
Copy link
Member

@sinhrks sinhrks commented Jul 25, 2016

after this PR:

idx = pd.Index([1, 2, np.nan, 4])
idx.dropna()
# Float64Index([1.0, 2.0, 4.0], dtype='float64')

MI has option how to drop if any/all levels are NA (the same as DataFrame)

midx = pd.MultiIndex.from_arrays([[1, 2, np.nan, 4], [1, 2, np.nan, np.nan]])
midx.dropna()
# MultiIndex(levels=[[1, 2, 4], [1, 2]],
#            labels=[[0, 1], [0, 1]])

midx.dropna(how='all')
# MultiIndex(levels=[[1, 2, 4], [1, 2]],
#            labels=[[0, 1, 2], [0, 1, -1]])

@sinhrks sinhrks added Indexing Related to indexing on series/frames, not to indexes themselves Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jul 25, 2016
@sinhrks sinhrks added this to the 0.19.0 milestone Jul 25, 2016
Copy link
Contributor

Choose a reason for hiding this comment

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

make a sub section I think (and maybe roll some other API changes there from Index eg where) might be others

Copy link
Contributor

Choose a reason for hiding this comment

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

or separate subsection. is fine too
whatever is more clear

@codecov-io
Copy link

codecov-io commented Jul 26, 2016

Current coverage is 85.24% (diff: 100%)

Merging #13791 into master will increase coverage by 0.01%

@@             master     #13791   diff @@
==========================================
  Files           140        140          
  Lines         50420      50438    +18   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42975      42998    +23   
+ Misses         7445       7440     -5   
  Partials          0          0          

Powered by Codecov. Last update cc216ad...1672f26

Copy link
Member

Choose a reason for hiding this comment

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

" drops values to all levels are missing." -> "only drops values where all levels are missing"

@jorisvandenbossche
Copy link
Member

Two minor comments, looks good to me for the rest!

@sinhrks
Copy link
Member Author

sinhrks commented Jul 27, 2016

Thanks, made changes for that were pointed out. Added New Index method section under what's new -> enhancement to organize relevant fixes.

midx.dropna(how='all')

- ``Index.astype()`` now accepts an optional boolean argument ``copy``, which allows optional copying if the requirements on dtype are satisfied (:issue:`13209`)
- ``Index`` now supports ``.str.extractall()`` which returns a ``DataFrame``, the see :ref:`docs here <text.extractall>` (:issue:`10008`, :issue:`13156`)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@jreback jreback closed this in dcb7bf7 Jul 29, 2016
@jreback
Copy link
Contributor

jreback commented Jul 29, 2016

thanks @sinhrks

@sinhrks sinhrks deleted the index_dropna branch July 29, 2016 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Indexing Related to indexing on series/frames, not to indexes themselves Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add dropna to Float64Index

4 participants