Loading tutorials
np.nan is NumPy's "not a number" value. Later chapters cover how to find, drop and fill missing values. This one covers only how pandas marks them.3 min readnp.nan is NumPy's "not a number" value. The previous chapter covered the markers pandas uses for missing data: NaN, None, NaT and pd.NA. Here you learn how to locate them and measure how m3 min readnp.nan is NumPy's "not a number" marker. The previous chapter showed how to find missing values with isna. That only works if pandas already knows which cells are missing. Real files often use a placeholder instead, s2 min readnp.nan is a floating-point "not a number" value. Earlier chapters showed how to detect missing values. Here you will learn what they do to arithmetic, comparisons and aggregations. Most surprises come from one split: agg2 min readisna. Dropping is the simplest way to handle missing data. It is also the easiest to misuse, because it removes information along with the gaps.2 min readisna. Here you replace missing values with fillna, using either a constant or a statistic computed from the data.2 min readnp.nan marks a missing float, and have used isna and fillna with a constant. It covers filling gaps by copying neighbouring values.2 min readnp.nan marks a missing float, and have used fillna with a constant. Interpolation estimates a missing value from the values around it. It suits data with a meaningful order, such as a time series or a sensor reading.3 min readfillna with constants and statistics, and the basics of groupby. A single overall mean can be a poor fill value when groups differ a lot. Filling within groups uses a value computed from each row's own group.2 min readnp.nan is a float. You should also know how isna finds missing values. Here you will see why NaN can change your column types, and how nullable dtypes avoid that.2 min readisna and fillna from earlier chapters. The code here only inspects data. It does not clean it. The aim is to decide whether a cleaning method is safe before you apply it.2 min readisna, dropna, fillna, ffill, interpolate and groupby. It also assumes you know the three missingness mechanisms: MCAR (missing completely at random), MAR (missing at random, explained by other columns) and MNAR (missing not at random, explained by the mis2 min readisna, dropna, fillna and groupby, and know that np.nan is a float. It covers mistakes that run without errors but give wrong or surprising results.2 min read