Skip to content

Instantly share code, notes, and snippets.

@rodrigols89
Created September 18, 2020 21:18
Show Gist options
  • Save rodrigols89/98697544f40ca2ceb1d32c4d140b059d to your computer and use it in GitHub Desktop.
Save rodrigols89/98697544f40ca2ceb1d32c4d140b059d to your computer and use it in GitHub Desktop.
import pandas as pd
pd.set_option('display.max_columns', 42)
data = pd.read_csv('../datasets/2015-building-energy-benchmarking.csv')
# Exibe a média de cada coluna.
print((data.isnull().sum() / len(data['OSEBuildingID'])) * 100, '\n')
data['ENERGYSTARScore'] = data['ENERGYSTARScore'].fillna(data['ENERGYSTARScore'].median())
# Exibe a média de cada coluna depois de substituir os NaN da coluna - ENERGYSTARScore
print((data.isnull().sum() / len(data['OSEBuildingID'])) * 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment