# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import pandas as pd

df = pd.read_excel('Census1971to2001.xlsx')

df

df.at[1, 'Name of the State/UT'] = 'Assam'

df = df.drop(df.columns[6], axis=1)

df.columns = ['SNo', 'Name of the State/UT', '1971', '1981', '1991', '2001']

df = df.drop(df.index[[0,1,37,38]])
df = df.reset_index(drop=True)

df.at[33, 'Name of the State/UT'] = 'Mizoram'

import numpy as np

df = df.replace(np.NaN, 0)

df

df.at[6, '1991'] = 0

df.at[18, '2001'] = 177268

df.at[18, '1991'] = 142868 

df

import matplotlib.pyplot as plt

ax = plt.gca()
i = 0 
for name, values in df.iteritems():
    if i == 0 or i == 1:
        pass
    else:
        ax = plt.gca()
        df.plot(kind='bar', x='Name of the State/UT', y='{name}'.format(name=name), ax=ax)
        plt.show()
    i=i+1
i=0



StarcoderdataJupyterScriptsDedupFiltered