Skip to content

Commit

Permalink
Update pandas.md
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay authored Nov 19, 2023
1 parent 6ec0b79 commit cc22be9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/python/pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ df = pd.read_csv(

## Display Data

- count values in column (without `NaN` values): `df["col_name"].value_counts()`
- count values in column (with `NaN` values): `df["col_name"].value_counts(dropna=False)`
- count values in colums
- without `NaN` values: `df["col_name"].value_counts()`
- with `NaN` values: `df["col_name"].value_counts(dropna=False)`
- see <https://pandas.pydata.org/docs/reference/api/pandas.Series.value_counts.html>
- duplicates
- display duplicate rows: `df[df.duplicated(keep=False)]`
- display duplicate entries in column: `df[df["column_name"].duplicated(keep=False)]`
Expand Down

0 comments on commit cc22be9

Please sign in to comment.