From 51d5f59c360137c61d8bde9cc76b15b26f46520e Mon Sep 17 00:00:00 2001 From: hathawayj Date: Tue, 6 Feb 2024 16:16:14 +0000 Subject: [PATCH] deploy: 6ca7cb8624376b03a82897603e3d13f6153fc89e --- slides/p2/d3/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slides/p2/d3/index.html b/slides/p2/d3/index.html index 041f952..ada2f06 100644 --- a/slides/p2/d3/index.html +++ b/slides/p2/d3/index.html @@ -3,7 +3,7 @@

Day 2B: Missing Data

Welcome to class!

Announcements

The Way


Questions 1 and 2

What issues are we still running into?


How to work with missing data

What counts as missing data?


How to identify missing data

  • df.isnull().sum()
  • df.describe()
  • df.column.value_counts(dropna=False)
  • pd.crosstab()

Option 1: Remove missing values

Be careful with .dropna(), and make sure you know what it is doing to your data!

Let’s use the pandas example:

Day 2B: Missing Data

Welcome to class!

Announcements

The Way


Questions 1 and 2

What issues are we still running into?


How to work with missing data

What counts as missing data?


How to identify missing data

  • df.isnull().sum()
  • df.describe()
  • df.column.value_counts(dropna=False)
  • pd.crosstab()

Option 1: Remove missing values

Be careful with .dropna(), and make sure you know what it is doing to your data!

Let’s use the pandas example:

df = pd.DataFrame({"name": ['Alfred', 'Batman', 'Catwoman'],
                    "toy": [np.nan, 'Batmobile', 'Bullwhip'],
                    "born": [pd.NaT, pd.Timestamp("1940-04-25"),
                             pd.NaT]})