Professional Documents
Culture Documents
Summary of The Chapter "Working With Missing Values"
Summary of The Chapter "Working With Missing Values"
.
data['column'].unique()
To delete rows with missing values, call the method. To renumber, call
dropna()
The isnull() method returns a Boolean list, in which ‘True` means that a value
is missing in the column.
To substitute a value for a missing one, use the method with the
fillna()
value argument.
Not all empty values can be filled with the method, though. For
fillna()
example, it can’t be used for missing None values. The method only recognizes
NaN values in a table. To replace None values, call the method. Boolean
loc
indexing allows you to select all rows containing None in the desired column
and replace them with a new value.
The agg() method is used to apply some functions to particular columns. The
column name and the functions themselves are recorded in a data structure
called a dictionary. A dictionary is made up of a key and a value. The key is
the name of the column the functions must be used on, while the value is the
list of function names.
{'column':['function1','function2']}
After you use the agg() method, column names become binary. To refer to the
result of using ['function1'] on , simply write them one after the
['column']
other:
data['column']['function1']