Skip to content

Commit

Permalink
Update data_clean.md
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor-phil committed Nov 5, 2024
1 parent c19caed commit cca9326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lectures/pandas/data_clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ df.fillna(value=100)

```{code-cell} python
# use the _next_ valid observation to fill the missing data
df.fillna(method="bfill")
df.bfill() # in new versions of pandas, bfill will directly fill missing data
```

```{code-cell} python
# use the _previous_ valid observation to fill missing data
df.fillna(method="ffill")
df.ffill()
```

We will see more examples of dealing with missing data in future
Expand Down

0 comments on commit cca9326

Please sign in to comment.