Last active
January 16, 2018 23:18
-
-
Save AlexJuca/73465985e8cfb70ef73d121517617614 to your computer and use it in GitHub Desktop.
pandas dataset with empty cells
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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