Drop Missing Values

import pandas as pd #This drops all rows where "age" or "sex" is missing. new_df = df.dropna(subset=["age", "sex"])
Use dropna method to drop any rows that contain missing values.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.