Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
586 B
0
Indexable
Never
import pandas as pd
import numpy as np
import datetime as dt

df = pd.read_csv("melb_data.csv")
# df
df.describe()
# df.info()
# df.shape



df['YearBuilt'] = df['YearBuilt'].astype('Int64')
df['Bathroom'] = df['Bathroom'].astype('Int64')
df['Car'] = df['Car'].astype('Int64')
df['Propertycount'] = df['Propertycount'].astype('Int64')
# df.dropna(axis=0)
# df
# df.describe()

df2 = df.dropna(subset=['BuildingArea'])

df['CouncilArea'] = df['CouncilArea'].fillna('')
df['BuildingArea'] = df['BuildingArea'].fillna(0.0)
df['YearBuilt'] = df['YearBuilt'].fillna(dt.date.today().year)
df