Preserving Series with the where method

Boolean indexing necessarily filters your dataset by removing all the rows that don't match the criteria. Instead of dropping all these values, it is possible to keep them using the where method. The where method preserves the size of your Series or DataFrame and either sets the values that don't meet the criteria for missing or replaces them with something else.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset