/
githubmirror
/
pandas
Обзор
Документация
Войти
/
githubmirror
/
pandas
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
doc/source/getting_started/comparison/includes/missing.rst
31 строка
719 B
jbrockmendel
DEPR: fillna method kwd (#53496)
08 июн 2023, 00:31
Не верифицирован
08 июн 2023, 00:31
eca28a3
Код
Авторство
О чём код?
In pandas, :meth:`Series.isna` and :meth:`Series.notna` can be used to filter the rows. .. ipython:: python outer_join[outer_join["value_x"].isna()] outer_join[outer_join["value_x"].notna()] pandas provides :ref:`a variety of methods to work with missing data <missing_data>`. Here are some examples: Drop rows with missing values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. ipython:: python outer_join.dropna() Forward fill from previous rows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. ipython:: python outer_join.ffill() Replace missing values with a specified value ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using the mean: .. ipython:: python outer_join["value_x"].fillna(outer_join["value_x"].mean())