In [2]:
import pandas as pd
import matplotlib.pyplot as plt
pd.set_option('display.notebook_repr_html', False)
pd.set_option('display.max_columns', 20)
pd.set_option('display.max_rows', 25)

mpl.rc('figure', figsize=(10, 8))

In [3]:
Telephone_agg = pd.read_csv('./data/NumberOfTelephones.csv', index_col=[0])
Telephone_agg


Out[3]:
      WirelinePhones  Wireless
Year                          
2004           40.92     35.61
2005           41.42     56.95
2006           40.23    101.86
2007           40.77    165.09
2008           39.41    261.08
2009           37.97    391.76
2010           36.96    584.32
2011           34.73    811.59
2012           32.17    919.17
2013           30.21    867.81

[10 rows x 2 columns]

In [4]:
Telephone_agg.plot(kind='bar')


Out[4]:
<matplotlib.axes.AxesSubplot at 0x10d58d810>

In [5]:
phones_statewise = pd.read_csv('./data/PhonesStatewise.csv', index_col=[0])
phones_statewise.head()


Out[5]:
                   Fixed-2010  Fixed-2011  Fixed-2012  Fixed-2013  \
Circle                                                              
Andaman & Nicobar        0.02         NaN         NaN         NaN   
Andhra Pradesh           2.46        2.37        2.36        2.24   
Assam                    0.31        0.26        0.23        0.19   
Bihar                    0.97        1.20        0.61        0.39   
Chhatisgarh              0.27         NaN         NaN         NaN   

                   Wireless-2010  Wireless-2011  Wireless-2012  Wireless-2013  
Circle                                                                         
Andaman & Nicobar           0.13            NaN            NaN            NaN  
Andhra Pradesh             45.62          60.68          66.83          64.36  
Assam                       8.76          11.67          14.21          14.39  
Bihar                      35.66          53.54          63.48          60.30  
Chhatisgarh                 1.11            NaN            NaN            NaN  

[5 rows x 8 columns]

This table provides State-wise and Circle-wise data related to number of telephones in India (in millions) at end of March of that year from 2010 upto 2013.


In [6]:
phones_statewise.describe()


Out[6]:
       Fixed-2010  Fixed-2011  Fixed-2012  Fixed-2013  Wireless-2010  \
count   28.000000   23.000000   22.000000   22.000000      28.000000   
mean     1.320000    1.498261    1.461364    1.372273      20.868929   
std      1.027355    0.942924    1.070924    1.060830      15.254507   
min      0.020000    0.220000    0.200000    0.190000       0.130000   
25%      0.347500    0.705000    0.595000    0.430000       5.410000   
50%      1.170000    1.400000    1.170000    1.085000      22.145000   
75%      2.087500    2.175000    2.577500    2.390000      32.697500   
max      3.460000    3.000000    3.190000    3.110000      45.620000   

       Wireless-2011  Wireless-2012  Wireless-2013  
count      23.000000      22.000000      22.000000  
mean       35.286957      41.780000      39.444091  
std        18.700899      22.140603      21.492839  
min         5.750000       6.310000       6.840000  
25%        21.405000      25.397500      22.095000  
50%        38.820000      44.380000      40.795000  
75%        48.205000      55.192500      52.722500  
max        63.680000      77.680000      73.820000  

[8 rows x 8 columns]

In [7]:
df = pd.DataFrame()
df['fixed'] = phones_statewise[['Fixed-2011', 'Fixed-2011', 'Fixed-2012', 'Fixed-2013']].sum(axis=1)
df['wireless'] = phones_statewise[['Wireless-2010', 'Wireless-2011', 'Wireless-2012', 'Wireless-2013']].sum(axis=1)

In [8]:
df['fixed'].plot(kind='bar')


Out[8]:
<matplotlib.axes.AxesSubplot at 0x10e726e50>

In [9]:
df['wireless'].plot(kind='bar')


Out[9]:
<matplotlib.axes.AxesSubplot at 0x10eb80210>

In [10]:
mpl.rc('figure', figsize=(18, 10))
phones_statewise[['Wireless-2010', 'Wireless-2011', 'Wireless-2012', 'Wireless-2013']].plot(kind='bar')


Out[10]:
<matplotlib.axes.AxesSubplot at 0x10edcc350>

In [11]:
phones_statewise.ix['Mumbai'][['Wireless-2010', 'Wireless-2011', 'Wireless-2012', 'Wireless-2013']].plot()


Out[11]:
<matplotlib.axes.AxesSubplot at 0x10eb6a910>