Back
Close

Computing with Data

elgeish
104.1K views

Missing Data in Python

The code below defines a small dataframe with missing values, and demonstrates the isnull, dropna, and fillna methods:

import numpy as np
import pandas as pd
data = pd.DataFrame([[1, 2, np.nan],
[3, np.nan, 4],
[1, 2, 3]])
# Example 1 - the isnull method
print(f"data:\n{data}")
print("pd.isnull(data):")
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants