O'Reilly logo

Hands-On Data Analysis with NumPy and pandas by Curtis Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Filling missing information

We can use the fillna method to replace missing information in a series or DataFrame. We give fillna an object instructing the method how this information should be replaced. By default, the method creates a new DataFrame or series. We can give fillna a single value, a dict, a series, or a DataFrame. If given a single value, then all entries indicating missing information will be replaced with that value. A dict can be used for more advanced replacement schemes. The values of the dict could correspond to, say, columns of the DataFrame; think of it as telling how to fill missing information in each column. If a series is used for filling missing information in a series, then the past series tells how to fill particular ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required