image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('../input/BRAZIL_CITIES.csv', sep=';', decimal=',')

df.fillna(0.0, inplace=True)

mask1 = df['LONG'] != 0
mask2 = df['LAT'] != 0
mask3 = df['CAPITAL'] == 1

mask1 = df['LONG'] != 0
mask2 = df['LAT'] != 0
mask3 = df['CAPITAL'] == 1
scale_factor = 20000

pop_by_state = df[['STATE', 'ESTIMATED_POP']].groupby(by='STATE').sum().sort_values(by='ESTIMATED_POP', ascending=False)
plt.figure(figsize=(15, 10))
plt.bar(pop_by_state.index, pop_by_state['ESTIMATED_POP'])
plt.title('Population by state (2018)')
plt.show()