Skip to content

Instantly share code, notes, and snippets.

@AlexJuca
Last active January 16, 2018 23:18
Show Gist options
  • Save AlexJuca/73465985e8cfb70ef73d121517617614 to your computer and use it in GitHub Desktop.
Save AlexJuca/73465985e8cfb70ef73d121517617614 to your computer and use it in GitHub Desktop.
pandas dataset with empty cells
import numpy as np
import pandas as pd
# Create a dictionary that we used to create our pandas DataFrame
fake_dataset = {'Price':[1000,2109, np.nan], 'Size':[55,np.nan, 75], 'N of Rooms':[3, 2, 5]}
pd = pd.DataFrame(fake_dataset)
pd.dropna()
pd.dropna(axis=1)
x = pd.copy()
x.dropna(inplace=True)
pd.fillna(value=100, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment