Create a state supply table from the county supply table


In [1]:
import pandas as pd

In [6]:
countyFN = '../../Data/SupplyTable.csv'

In [7]:
dfCounty = pd.read_csv(countyFN,index_col=('YEAR','STATEFIPS'))

In [13]:
dfState = dfCounty.sum()

In [10]:
dfCounty['Supply'].unstack()


Out[10]:
YEAR  STATEFIPS
2000  1             374.635465
      1            1911.889367
      1             718.178001
      1             375.143732
      1             542.907950
      1             479.797183
      1             555.117585
      1             609.554587
      1             496.080920
      1             625.271330
      1             446.301598
      1             528.030134
      1             850.046126
      1             564.134018
      1             543.854228
      1             602.963822
      1             527.241671
      1             682.397812
      1             450.477367
      1             943.140508
      1             471.202224
      1             676.783380
      1             498.619292
      1             636.949321
      1             714.476384
      1             456.288130
      1             862.335801
      1             520.043203
      1             486.955772
      1             542.979849
                      ...     
2010  55            358.020602
      55            211.964280
      55            314.554714
      55            400.798475
      55            288.245316
      55            324.273754
      55            526.930868
      56            646.724157
      56            541.890515
      56            282.566068
      56           1642.706675
      56            360.935351
      56            102.194993
      56           1706.278842
      56            -12.847918
      56            383.702430
      56            638.133223
      56             38.596122
      56           1740.019749
      56            527.655515
      56             18.390951
      56           4559.090074
      56             57.433213
      56            598.799811
      56           1753.268674
      56            819.407051
      56           4674.220143
      56            301.109378
      56            378.733311
      56             69.150689
Name: Supply, dtype: float64