In [1]:
import quandl;
import pandas as pd;

import pickle; #serializates everything

In [2]:
api_key = open("quandlapikey.txt", "r").read();

def state_list():
    fiddy_states = pd.read_html("https://simple.wikipedia.org/wiki/List_of_U.S._states");
    return fiddy_states[0][0][1:];

def grap_initial_state_data():
    states = state_list();
    main_df = pd.DataFrame();
    for ab in states:
        querry = "FMAC/HPI_" + ab;
        df = quandl.get(querry, authtoken = api_key);
        df.columns = [ab];
        if main_df.empty:
            main_df = df;
        else:
            main_df = main_df.join(df);

    print(main_df);
    
    pickle_out = open("./data/fiddy_states.pickle", "wb");
    pickle.dump(main_df, pickle_out);
    pickle_out.close();
    
grap_initial_state_data();


                    AL          AK          AZ          AR          CA  \
Date                                                                     
1975-01-31   35.324038   34.400087   28.886571   36.838213   15.665713   
1975-02-28   35.545343   34.911194   29.374322   37.149935   15.721510   
1975-03-31   35.803942   35.434316   29.828662   37.420977   15.912556   
1975-04-30   36.120498   35.980265   30.179479   37.642638   16.225479   
1975-05-31   36.421849   36.576786   30.371230   37.864617   16.486814   
1975-06-30   36.590486   37.215581   30.341065   38.106971   16.603675   
1975-07-31   36.561117   37.854434   30.060008   38.320736   16.726829   
1975-08-31   36.368415   38.436448   29.605837   38.453521   16.946578   
1975-09-30   36.131918   38.943446   29.126406   38.472566   17.189078   
1975-10-31   36.008425   39.404582   28.857155   38.441129   17.411646   
1975-11-30   36.090303   39.816144   28.968939   38.489078   17.561873   
1975-12-31   36.404250   40.158353   29.328887   38.649827   17.684883   
1976-01-31   36.925921   40.433223   29.696800   38.886195   17.862281   
1976-02-29   37.533049   40.663165   29.970749   39.208687   18.072305   
1976-03-31   38.069736   40.875461   30.124848   39.624437   18.338306   
1976-04-30   38.441905   41.083213   30.172802   40.087663   18.636635   
1976-05-31   38.650744   41.288711   30.153995   40.510163   18.866269   
1976-06-30   38.740534   41.487980   30.114599   40.859775   19.092624   
1976-07-31   38.775837   41.658420   30.111794   41.179912   19.387552   
1976-08-31   38.779539   41.791503   30.171778   41.488439   19.693480   
1976-09-30   38.774803   41.953295   30.268635   41.716690   19.973990   
1976-10-31   38.828996   42.203508   30.442029   41.828868   20.262515   
1976-11-30   38.989816   42.538644   30.671523   41.903342   20.616467   
1976-12-31   39.172518   42.942218   30.831487   42.032785   20.969382   
1977-01-31   39.278672   43.374455   30.912661   42.276791   21.334689   
1977-02-28   39.335596   43.778090   31.018548   42.633729   21.810607   
1977-03-31   39.405721   44.105610   31.253723   43.023820   22.396793   
1977-04-30   39.584691   44.355925   31.559454   43.354717   22.976736   
1977-05-31   39.884161   44.570503   31.826824   43.616474   23.568025   
1977-06-30   40.274790   44.778705   32.158509   43.880247   24.163723   
...                ...         ...         ...         ...         ...   
2014-04-30  122.173929  167.381095  146.428711  128.348282  173.952067   
2014-05-31  122.956840  168.651124  147.183106  128.958279  175.307719   
2014-06-30  123.826006  169.698522  147.716340  129.613908  176.465943   
2014-07-31  124.543187  170.381320  147.933007  130.365747  177.585617   
2014-08-31  124.763300  170.561829  147.758872  131.140323  178.089604   
2014-09-30  124.288439  170.199592  147.643074  131.461803  178.091919   
2014-10-31  123.466585  169.424053  148.277175  131.226269  178.150331   
2014-11-30  122.910152  168.528501  149.383794  130.572864  178.302662   
2014-12-31  122.824462  167.922136  150.197707  129.750256  178.729063   
2015-01-31  123.119710  167.804787  150.823301  129.225046  179.561763   
2015-02-28  123.584841  168.224891  151.887044  129.270520  181.124566   
2015-03-31  124.329447  169.300411  153.337145  129.862267  183.744745   
2015-04-30  125.331854  171.009001  154.872185  130.867604  186.238378   
2015-05-31  126.409915  173.030424  156.223713  131.996619  188.156440   
2015-06-30  127.308601  174.822178  157.261938  132.908571  189.696463   
2015-07-31  127.752902  175.956885  158.221163  133.650170  190.823397   
2015-08-31  127.694435  176.451718  159.190502  134.316861  191.701212   
2015-09-30  127.192833  176.422094  160.081806  134.739122  192.165009   
2015-10-31  126.608909  176.037791  160.535391  134.722548  192.481135   
2015-11-30  126.153921  175.707531  160.680822  134.279114  192.985071   
2015-12-31  125.906859  175.458560  160.900720  133.632536  193.458320   
2016-01-31  126.175659  175.217552  161.492384  133.115415  193.900640   
2016-02-29  127.021791  175.215718  162.958713  133.140939  195.817304   
2016-03-31  128.216246  175.672794  165.027980  133.918661  198.884173   
2016-04-30  129.632823  176.566959  166.793290  135.107643  201.081930   
2016-05-31  130.896566  177.607628  167.811335  136.255567  202.753913   
2016-06-30  131.856724  178.357410  168.530702  137.224830  204.252882   
2016-07-31  132.615463  178.699705  169.148940  137.923912  205.334549   
2016-08-31  132.971594  178.839224  169.102253  138.328841  206.372559   
2016-09-30  132.719493  178.261698  168.697402  138.476078  206.890383   

                    CO          CT          DE          FL          GA  \
Date                                                                     
1975-01-31   19.666460   24.530646   27.146975   30.903838   30.862154   
1975-02-28   19.894520   25.051659   27.185646   32.121077   30.583518   
1975-03-31   20.118681   25.443161   27.252283   33.931871   30.466267   
1975-04-30   20.327062   25.663172   27.389022   36.149709   30.532432   
1975-05-31   20.497741   25.733086   27.622613   36.433117   30.653270   
1975-06-30   20.639312   25.704361   27.900351   34.834238   30.689399   
1975-07-31   20.736599   25.661333   28.145452   33.602206   30.576507   
1975-08-31   20.733277   25.652680   28.350528   33.010279   30.315407   
1975-09-30   20.660068   25.697453   28.519330   32.875380   29.954206   
1975-10-31   20.630697   25.806522   28.627883   33.022794   29.661032   
1975-11-30   20.735808   26.000473   28.689157   33.280485   29.572891   
1975-12-31   20.945268   26.226026   28.729921   33.413898   29.638227   
1976-01-31   21.174193   26.407600   28.744692   33.371614   29.741952   
1976-02-29   21.384153   26.523621   28.736221   33.399627   29.781223   
1976-03-31   21.585920   26.588799   28.735642   33.963160   29.762143   
1976-04-30   21.763148   26.642871   28.789572   35.196647   29.815519   
1976-05-31   21.880078   26.717137   28.871497   35.536372   30.032654   
1976-06-30   21.949178   26.843928   28.912344   34.681056   30.439132   
1976-07-31   21.979567   27.023066   28.903111   34.065245   30.881534   
1976-08-31   21.987110   27.166947   28.867125   33.937690   31.108121   
1976-09-30   22.026557   27.237751   28.836981   34.050850   31.136604   
1976-10-31   22.174569   27.320801   28.857260   34.161330   31.061085   
1976-11-30   22.439189   27.384054   28.960945   34.220250   30.952427   
1976-12-31   22.712517   27.341973   29.140617   34.052027   30.893195   
1977-01-31   22.917952   27.269344   29.363955   33.542570   30.885439   
1977-02-28   23.090199   27.248829   29.580804   32.863308   30.937739   
1977-03-31   23.282323   27.332044   29.728320   32.995422   31.047085   
1977-04-30   23.551533   27.627403   29.778840   34.758602   31.208834   
1977-05-31   23.897001   28.120572   29.758977   35.984563   31.401141   
1977-06-30   24.303410   28.678526   29.736083   35.537803   31.608643   
...                ...         ...         ...         ...         ...   
2014-04-30  136.912396  130.645071  145.856214  148.957694  112.180390   
2014-05-31  138.639615  132.500672  147.290584  150.657274  113.638452   
2014-06-30  139.788935  133.930633  148.667923  152.020323  114.993223   
2014-07-31  140.383673  134.002863  149.743734  152.713620  115.870378   
2014-08-31  140.908019  133.282578  150.379461  153.061114  116.132540   
2014-09-30  141.473633  132.536691  150.437727  153.675585  116.111767   
2014-10-31  142.036413  131.932251  149.845360  154.336584  116.073782   
2014-11-30  142.535747  131.077826  148.964742  154.827766  115.842214   
2014-12-31  143.058885  129.907765  148.170077  155.438487  115.543092   
2015-01-31  144.194550  129.011508  147.644147  156.363977  115.908063   
2015-02-28  146.308133  128.912905  147.579889  158.000000  116.959045   
2015-03-31  148.911538  129.763784  148.153344  159.991414  118.559243   
2015-04-30  151.500568  131.315037  149.371452  161.965384  120.324201   
2015-05-31  153.833351  133.055427  150.752497  164.351924  121.784083   
2015-06-30  155.591250  134.427315  151.577074  166.717058  122.787675   
2015-07-31  156.764865  135.028205  151.688104  168.500397  123.340654   
2015-08-31  157.267472  134.512013  151.634580  169.402406  123.655070   
2015-09-30  157.376105  133.171087  151.841835  169.993288  123.918125   
2015-10-31  157.403376  131.956323  152.417434  170.997800  124.086719   
2015-11-30  157.152857  131.100818  153.164890  171.903492  124.028885   
2015-12-31  157.347098  130.293382  153.667542  172.260571  124.076959   
2016-01-31  158.728845  129.677435  153.835051  172.693556  124.416161   
2016-02-29  161.093900  129.644707  153.872571  174.402953  125.158237   
2016-03-31  164.092490  130.298984  154.042343  177.236283  126.651611   
2016-04-30  167.169123  131.578392  154.385247  179.719315  128.828975   
2016-05-31  169.871223  133.021914  154.641651  181.712801  130.784349   
2016-06-30  171.773235  134.138562  154.775456  183.589784  131.886442   
2016-07-31  172.872056  134.596841  154.900620  185.132100  132.344485   
2016-08-31  173.349929  134.197366  154.922160  186.697343  132.121392   
2016-09-30  173.470612  133.367534  154.800912  187.893595  131.677509   

               ...              SD          TN          TX          UT  \
Date           ...                                                       
1975-01-31     ...       37.861487   32.210851   32.659989   24.603939   
1975-02-28     ...       37.445064   32.246969   32.970745   24.947973   
1975-03-31     ...       37.021567   32.329769   33.542148   25.258222   
1975-04-30     ...       36.601128   32.457447   34.383316   25.504964   
1975-05-31     ...       36.220049   32.606660   34.652016   25.668351   
1975-06-30     ...       35.935119   32.768038   34.254694   25.715601   
1975-07-31     ...       35.755839   32.930648   33.988356   25.646302   
1975-08-31     ...       35.632394   33.100638   33.970148   25.537333   
1975-09-30     ...       35.535764   33.329637   34.055459   25.488392   
1975-10-31     ...       35.474718   33.676200   34.164316   25.620796   
1975-11-30     ...       35.467993   34.133338   34.378406   25.967261   
1975-12-31     ...       35.539198   34.545489   34.584268   26.376973   
1976-01-31     ...       35.701897   34.741160   34.718205   26.754665   
1976-02-29     ...       35.957179   34.721585   35.017963   27.114928   
1976-03-31     ...       36.278858   34.647570   35.737393   27.438840   
1976-04-30     ...       36.616424   34.685411   36.766017   27.719833   
1976-05-31     ...       36.935243   34.778605   37.086576   27.937016   
1976-06-30     ...       37.222773   34.776904   36.697637   28.065296   
1976-07-31     ...       37.505886   34.718738   36.507198   28.196911   
1976-08-31     ...       37.794998   34.701488   36.507497   28.374092   
1976-09-30     ...       38.028377   34.729741   36.595015   28.525929   
1976-10-31     ...       38.138147   34.790484   36.807451   28.667924   
1976-11-30     ...       38.131314   34.886907   37.108322   28.881230   
1976-12-31     ...       38.095860   35.054866   37.303658   29.192514   
1977-01-31     ...       38.107546   35.350964   37.474727   29.540404   
1977-02-28     ...       38.203612   35.781724   37.947081   29.897479   
1977-03-31     ...       38.423861   36.283095   39.045190   30.304343   
1977-04-30     ...       38.811868   36.774259   40.734923   30.768626   
1977-05-31     ...       39.357182   37.209644   41.015677   31.250531   
1977-06-30     ...       40.000423   37.627178   39.987010   31.718802   
...            ...             ...         ...         ...         ...   
2014-04-30     ...      147.110078  131.938195  149.750687  145.016658   
2014-05-31     ...      148.048576  133.059128  151.491445  146.119087   
2014-06-30     ...      148.754869  133.774886  152.950676  146.705849   
2014-07-31     ...      149.232552  134.107252  153.958918  146.915163   
2014-08-31     ...      149.582822  134.005265  154.700157  146.989397   
2014-09-30     ...      149.766985  133.980003  155.258659  147.006850   
2014-10-31     ...      149.893916  134.121209  155.562846  146.768810   
2014-11-30     ...      149.955608  133.945146  155.935939  146.409317   
2014-12-31     ...      150.022712  133.667845  156.370918  146.527718   
2015-01-31     ...      150.354085  133.828507  156.874024  147.345153   
2015-02-28     ...      151.136156  134.616780  158.024475  148.816031   
2015-03-31     ...      152.421239  135.878894  159.893825  150.660758   
2015-04-30     ...      153.838578  137.392921  161.839395  152.497640   
2015-05-31     ...      155.094103  139.000920  163.662033  154.187387   
2015-06-30     ...      156.119980  140.257899  165.361119  155.463631   
2015-07-31     ...      156.923030  140.926379  166.537058  156.262592   
2015-08-31     ...      157.468603  141.259217  166.825724  156.833480   
2015-09-30     ...      157.819092  141.518909  166.927714  157.382971   
2015-10-31     ...      158.119634  141.678581  167.349793  157.926230   
2015-11-30     ...      158.332860  141.605853  167.649963  158.314232   
2015-12-31     ...      158.557020  141.433863  167.738984  158.713564   
2016-01-31     ...      158.862737  141.563101  168.352857  159.447341   
2016-02-29     ...      159.144772  142.271182  169.904181  160.470145   
2016-03-31     ...      159.507797  143.657624  171.544114  162.069829   
2016-04-30     ...      160.123534  145.568366  173.229875  164.485491   
2016-05-31     ...      161.123521  147.264123  175.298871  166.767003   
2016-06-30     ...      162.430436  148.308823  176.893272  168.272200   
2016-07-31     ...      163.655104  149.423989  177.950783  169.529933   
2016-08-31     ...      164.685799  150.994296  178.682159  170.704408   
2016-09-30     ...      165.537323  152.106683  178.934070  171.775365   

                    VT          VA          WA          WV          WI  \
Date                                                                     
1975-01-31   26.556884   27.954539   17.480301   41.248346   28.142079   
1975-02-28   26.807912   28.230531   17.549796   42.277521   28.537453   
1975-03-31   27.050106   28.431856   17.657853   43.349320   28.927629   
1975-04-30   27.270090   28.580271   17.787585   44.454450   29.277377   
1975-05-31   27.463349   28.704849   17.904450   45.566959   29.562586   
1975-06-30   27.638171   28.825927   18.024628   46.629673   29.778909   
1975-07-31   27.786969   29.005768   18.162628   47.564471   29.944745   
1975-08-31   27.891178   29.200001   18.257222   48.313434   30.087332   
1975-09-30   27.957536   29.271384   18.276371   48.820033   30.276329   
1975-10-31   28.002721   29.229291   18.300167   49.050839   30.506126   
1975-11-30   28.028365   29.136459   18.426990   49.072358   30.668776   
1975-12-31   28.029480   29.024846   18.631743   48.992814   30.726720   
1976-01-31   28.006022   28.949221   18.845818   48.892301   30.726264   
1976-02-29   27.969583   29.012709   19.070075   48.849298   30.707069   
1976-03-31   27.950651   29.216527   19.296205   48.887318   30.727065   
1976-04-30   27.991607   29.454310   19.508391   48.941399   30.860484   
1976-05-31   28.105903   29.697488   19.741712   48.947711   31.095498   
1976-06-30   28.280967   29.905821   20.053612   48.888631   31.310072   
1976-07-31   28.496864   30.044986   20.445033   48.774808   31.464677   
1976-08-31   28.722776   30.207800   20.779096   48.648477   31.631205   
1976-09-30   28.925624   30.374140   20.967548   48.566543   31.829676   
1976-10-31   29.083661   30.486756   21.097636   48.548314   32.019483   
1976-11-30   29.202067   30.599379   21.276232   48.601173   32.242660   
1976-12-31   29.306483   30.696932   21.487053   48.755463   32.535928   
1977-01-31   29.424696   30.777994   21.644120   49.039363   32.865996   
1977-02-28   29.574836   30.910326   21.810916   49.445567   33.275297   
1977-03-31   29.772613   31.118114   22.125576   49.950923   33.781418   
1977-04-30   30.028769   31.366169   22.621918   50.541364   34.284900   
1977-05-31   30.344817   31.656930   23.163234   51.150589   34.767809   
1977-06-30   30.709720   31.993945   23.661773   51.697094   35.350264   
...                ...         ...         ...         ...         ...   
2014-04-30  160.515146  169.138464  152.187938  137.650937  119.548660   
2014-05-31  161.875803  170.731341  154.350742  138.470614  121.148730   
2014-06-30  162.938340  171.734252  156.043447  139.363821  122.402881   
2014-07-31  163.218396  171.891208  157.195348  140.335620  123.023871   
2014-08-31  162.578335  171.330539  157.373396  141.265889  122.997969   
2014-09-30  161.272823  170.516212  156.898485  141.790293  122.650383   
2014-10-31  159.707086  169.872653  156.718081  141.517479  122.142191   
2014-11-30  158.367369  169.467795  157.053266  140.571851  121.204688   
2014-12-31  157.596159  168.959114  157.373542  139.613978  120.003212   
2015-01-31  157.504410  168.329549  157.991065  139.209850  119.428768   
2015-02-28  158.118886  168.426373  159.707938  139.643743  119.936387   
2015-03-31  159.544315  169.739348  162.407389  140.923249  121.213489   
2015-04-30  161.770072  171.653057  165.353447  142.679870  122.930672   
2015-05-31  164.304970  173.503033  167.954918  144.226155  124.891490   
2015-06-30  166.245077  174.812783  170.119038  145.026587  126.324245   
2015-07-31  167.076880  175.285143  171.797675  145.087954  126.860861   
2015-08-31  166.961725  175.330590  172.745129  144.651914  126.873732   
2015-09-30  166.282498  175.200181  173.217187  143.879008  126.594458   
2015-10-31  165.307887  174.573001  173.868602  142.973366  126.366760   
2015-11-30  164.247041  173.524722  174.594670  142.006219  126.176309   
2015-12-31  163.345512  172.489851  175.123311  141.023153  125.569254   
2016-01-31  162.772990  172.224609  176.253622  140.223109  125.059323   
2016-02-29  162.604804  173.372212  178.893490  139.890822  125.552409   
2016-03-31  162.923357  175.508190  182.280465  140.298013  127.047139   
2016-04-30  163.881497  177.662737  185.456555  141.410083  128.956812   
2016-05-31  165.235066  179.538071  188.146606  142.856780  130.942732   
2016-06-30  166.682834  180.683646  190.166799  144.058204  132.794747   
2016-07-31  168.117871  180.795907  191.790489  144.654369  134.008859   
2016-08-31  169.373685  180.641917  193.140805  144.861570  134.538152   
2016-09-30  169.400854  180.218407  193.589674  144.750584  134.650743   

                    WY  
Date                    
1975-01-31   31.820164  
1975-02-28   32.277898  
1975-03-31   32.762841  
1975-04-30   33.266394  
1975-05-31   33.755117  
1975-06-30   34.212608  
1975-07-31   34.638376  
1975-08-31   35.021073  
1975-09-30   35.349940  
1975-10-31   35.601126  
1975-11-30   35.774498  
1975-12-31   35.897251  
1976-01-31   36.002504  
1976-02-29   36.135603  
1976-03-31   36.325315  
1976-04-30   36.579803  
1976-05-31   36.922370  
1976-06-30   37.389307  
1976-07-31   37.960048  
1976-08-31   38.555582  
1976-09-30   39.145237  
1976-10-31   39.741515  
1976-11-30   40.304472  
1976-12-31   40.763972  
1977-01-31   41.124995  
1977-02-28   41.449422  
1977-03-31   41.775817  
1977-04-30   42.122977  
1977-05-31   42.518585  
1977-06-30   43.014464  
...                ...  
2014-04-30  176.170184  
2014-05-31  177.523354  
2014-06-30  178.629459  
2014-07-31  179.200524  
2014-08-31  179.334276  
2014-09-30  179.364439  
2014-10-31  179.518490  
2014-11-30  179.761524  
2014-12-31  179.986943  
2015-01-31  180.265440  
2015-02-28  180.705328  
2015-03-31  181.541818  
2015-04-30  182.886627  
2015-05-31  184.576563  
2015-06-30  186.257348  
2015-07-31  187.411175  
2015-08-31  187.668120  
2015-09-30  187.197997  
2015-10-31  186.295403  
2015-11-30  185.146602  
2015-12-31  184.146732  
2016-01-31  183.681564  
2016-02-29  183.891939  
2016-03-31  184.701842  
2016-04-30  185.767732  
2016-05-31  186.626342  
2016-06-30  187.205044  
2016-07-31  187.682782  
2016-08-31  188.017950  
2016-09-30  187.743011  

[501 rows x 50 columns]

In [3]:
pickle_in = open("./data/fiddy_states.pickle", "rb");
HPI_data = pickle.load(pickle_in);

print(HPI_data);


                    AL          AK          AZ          AR          CA  \
Date                                                                     
1975-01-31   35.324038   34.400087   28.886571   36.838213   15.665713   
1975-02-28   35.545343   34.911194   29.374322   37.149935   15.721510   
1975-03-31   35.803942   35.434316   29.828662   37.420977   15.912556   
1975-04-30   36.120498   35.980265   30.179479   37.642638   16.225479   
1975-05-31   36.421849   36.576786   30.371230   37.864617   16.486814   
1975-06-30   36.590486   37.215581   30.341065   38.106971   16.603675   
1975-07-31   36.561117   37.854434   30.060008   38.320736   16.726829   
1975-08-31   36.368415   38.436448   29.605837   38.453521   16.946578   
1975-09-30   36.131918   38.943446   29.126406   38.472566   17.189078   
1975-10-31   36.008425   39.404582   28.857155   38.441129   17.411646   
1975-11-30   36.090303   39.816144   28.968939   38.489078   17.561873   
1975-12-31   36.404250   40.158353   29.328887   38.649827   17.684883   
1976-01-31   36.925921   40.433223   29.696800   38.886195   17.862281   
1976-02-29   37.533049   40.663165   29.970749   39.208687   18.072305   
1976-03-31   38.069736   40.875461   30.124848   39.624437   18.338306   
1976-04-30   38.441905   41.083213   30.172802   40.087663   18.636635   
1976-05-31   38.650744   41.288711   30.153995   40.510163   18.866269   
1976-06-30   38.740534   41.487980   30.114599   40.859775   19.092624   
1976-07-31   38.775837   41.658420   30.111794   41.179912   19.387552   
1976-08-31   38.779539   41.791503   30.171778   41.488439   19.693480   
1976-09-30   38.774803   41.953295   30.268635   41.716690   19.973990   
1976-10-31   38.828996   42.203508   30.442029   41.828868   20.262515   
1976-11-30   38.989816   42.538644   30.671523   41.903342   20.616467   
1976-12-31   39.172518   42.942218   30.831487   42.032785   20.969382   
1977-01-31   39.278672   43.374455   30.912661   42.276791   21.334689   
1977-02-28   39.335596   43.778090   31.018548   42.633729   21.810607   
1977-03-31   39.405721   44.105610   31.253723   43.023820   22.396793   
1977-04-30   39.584691   44.355925   31.559454   43.354717   22.976736   
1977-05-31   39.884161   44.570503   31.826824   43.616474   23.568025   
1977-06-30   40.274790   44.778705   32.158509   43.880247   24.163723   
...                ...         ...         ...         ...         ...   
2014-04-30  122.173929  167.381095  146.428711  128.348282  173.952067   
2014-05-31  122.956840  168.651124  147.183106  128.958279  175.307719   
2014-06-30  123.826006  169.698522  147.716340  129.613908  176.465943   
2014-07-31  124.543187  170.381320  147.933007  130.365747  177.585617   
2014-08-31  124.763300  170.561829  147.758872  131.140323  178.089604   
2014-09-30  124.288439  170.199592  147.643074  131.461803  178.091919   
2014-10-31  123.466585  169.424053  148.277175  131.226269  178.150331   
2014-11-30  122.910152  168.528501  149.383794  130.572864  178.302662   
2014-12-31  122.824462  167.922136  150.197707  129.750256  178.729063   
2015-01-31  123.119710  167.804787  150.823301  129.225046  179.561763   
2015-02-28  123.584841  168.224891  151.887044  129.270520  181.124566   
2015-03-31  124.329447  169.300411  153.337145  129.862267  183.744745   
2015-04-30  125.331854  171.009001  154.872185  130.867604  186.238378   
2015-05-31  126.409915  173.030424  156.223713  131.996619  188.156440   
2015-06-30  127.308601  174.822178  157.261938  132.908571  189.696463   
2015-07-31  127.752902  175.956885  158.221163  133.650170  190.823397   
2015-08-31  127.694435  176.451718  159.190502  134.316861  191.701212   
2015-09-30  127.192833  176.422094  160.081806  134.739122  192.165009   
2015-10-31  126.608909  176.037791  160.535391  134.722548  192.481135   
2015-11-30  126.153921  175.707531  160.680822  134.279114  192.985071   
2015-12-31  125.906859  175.458560  160.900720  133.632536  193.458320   
2016-01-31  126.175659  175.217552  161.492384  133.115415  193.900640   
2016-02-29  127.021791  175.215718  162.958713  133.140939  195.817304   
2016-03-31  128.216246  175.672794  165.027980  133.918661  198.884173   
2016-04-30  129.632823  176.566959  166.793290  135.107643  201.081930   
2016-05-31  130.896566  177.607628  167.811335  136.255567  202.753913   
2016-06-30  131.856724  178.357410  168.530702  137.224830  204.252882   
2016-07-31  132.615463  178.699705  169.148940  137.923912  205.334549   
2016-08-31  132.971594  178.839224  169.102253  138.328841  206.372559   
2016-09-30  132.719493  178.261698  168.697402  138.476078  206.890383   

                    CO          CT          DE          FL          GA  \
Date                                                                     
1975-01-31   19.666460   24.530646   27.146975   30.903838   30.862154   
1975-02-28   19.894520   25.051659   27.185646   32.121077   30.583518   
1975-03-31   20.118681   25.443161   27.252283   33.931871   30.466267   
1975-04-30   20.327062   25.663172   27.389022   36.149709   30.532432   
1975-05-31   20.497741   25.733086   27.622613   36.433117   30.653270   
1975-06-30   20.639312   25.704361   27.900351   34.834238   30.689399   
1975-07-31   20.736599   25.661333   28.145452   33.602206   30.576507   
1975-08-31   20.733277   25.652680   28.350528   33.010279   30.315407   
1975-09-30   20.660068   25.697453   28.519330   32.875380   29.954206   
1975-10-31   20.630697   25.806522   28.627883   33.022794   29.661032   
1975-11-30   20.735808   26.000473   28.689157   33.280485   29.572891   
1975-12-31   20.945268   26.226026   28.729921   33.413898   29.638227   
1976-01-31   21.174193   26.407600   28.744692   33.371614   29.741952   
1976-02-29   21.384153   26.523621   28.736221   33.399627   29.781223   
1976-03-31   21.585920   26.588799   28.735642   33.963160   29.762143   
1976-04-30   21.763148   26.642871   28.789572   35.196647   29.815519   
1976-05-31   21.880078   26.717137   28.871497   35.536372   30.032654   
1976-06-30   21.949178   26.843928   28.912344   34.681056   30.439132   
1976-07-31   21.979567   27.023066   28.903111   34.065245   30.881534   
1976-08-31   21.987110   27.166947   28.867125   33.937690   31.108121   
1976-09-30   22.026557   27.237751   28.836981   34.050850   31.136604   
1976-10-31   22.174569   27.320801   28.857260   34.161330   31.061085   
1976-11-30   22.439189   27.384054   28.960945   34.220250   30.952427   
1976-12-31   22.712517   27.341973   29.140617   34.052027   30.893195   
1977-01-31   22.917952   27.269344   29.363955   33.542570   30.885439   
1977-02-28   23.090199   27.248829   29.580804   32.863308   30.937739   
1977-03-31   23.282323   27.332044   29.728320   32.995422   31.047085   
1977-04-30   23.551533   27.627403   29.778840   34.758602   31.208834   
1977-05-31   23.897001   28.120572   29.758977   35.984563   31.401141   
1977-06-30   24.303410   28.678526   29.736083   35.537803   31.608643   
...                ...         ...         ...         ...         ...   
2014-04-30  136.912396  130.645071  145.856214  148.957694  112.180390   
2014-05-31  138.639615  132.500672  147.290584  150.657274  113.638452   
2014-06-30  139.788935  133.930633  148.667923  152.020323  114.993223   
2014-07-31  140.383673  134.002863  149.743734  152.713620  115.870378   
2014-08-31  140.908019  133.282578  150.379461  153.061114  116.132540   
2014-09-30  141.473633  132.536691  150.437727  153.675585  116.111767   
2014-10-31  142.036413  131.932251  149.845360  154.336584  116.073782   
2014-11-30  142.535747  131.077826  148.964742  154.827766  115.842214   
2014-12-31  143.058885  129.907765  148.170077  155.438487  115.543092   
2015-01-31  144.194550  129.011508  147.644147  156.363977  115.908063   
2015-02-28  146.308133  128.912905  147.579889  158.000000  116.959045   
2015-03-31  148.911538  129.763784  148.153344  159.991414  118.559243   
2015-04-30  151.500568  131.315037  149.371452  161.965384  120.324201   
2015-05-31  153.833351  133.055427  150.752497  164.351924  121.784083   
2015-06-30  155.591250  134.427315  151.577074  166.717058  122.787675   
2015-07-31  156.764865  135.028205  151.688104  168.500397  123.340654   
2015-08-31  157.267472  134.512013  151.634580  169.402406  123.655070   
2015-09-30  157.376105  133.171087  151.841835  169.993288  123.918125   
2015-10-31  157.403376  131.956323  152.417434  170.997800  124.086719   
2015-11-30  157.152857  131.100818  153.164890  171.903492  124.028885   
2015-12-31  157.347098  130.293382  153.667542  172.260571  124.076959   
2016-01-31  158.728845  129.677435  153.835051  172.693556  124.416161   
2016-02-29  161.093900  129.644707  153.872571  174.402953  125.158237   
2016-03-31  164.092490  130.298984  154.042343  177.236283  126.651611   
2016-04-30  167.169123  131.578392  154.385247  179.719315  128.828975   
2016-05-31  169.871223  133.021914  154.641651  181.712801  130.784349   
2016-06-30  171.773235  134.138562  154.775456  183.589784  131.886442   
2016-07-31  172.872056  134.596841  154.900620  185.132100  132.344485   
2016-08-31  173.349929  134.197366  154.922160  186.697343  132.121392   
2016-09-30  173.470612  133.367534  154.800912  187.893595  131.677509   

               ...              SD          TN          TX          UT  \
Date           ...                                                       
1975-01-31     ...       37.861487   32.210851   32.659989   24.603939   
1975-02-28     ...       37.445064   32.246969   32.970745   24.947973   
1975-03-31     ...       37.021567   32.329769   33.542148   25.258222   
1975-04-30     ...       36.601128   32.457447   34.383316   25.504964   
1975-05-31     ...       36.220049   32.606660   34.652016   25.668351   
1975-06-30     ...       35.935119   32.768038   34.254694   25.715601   
1975-07-31     ...       35.755839   32.930648   33.988356   25.646302   
1975-08-31     ...       35.632394   33.100638   33.970148   25.537333   
1975-09-30     ...       35.535764   33.329637   34.055459   25.488392   
1975-10-31     ...       35.474718   33.676200   34.164316   25.620796   
1975-11-30     ...       35.467993   34.133338   34.378406   25.967261   
1975-12-31     ...       35.539198   34.545489   34.584268   26.376973   
1976-01-31     ...       35.701897   34.741160   34.718205   26.754665   
1976-02-29     ...       35.957179   34.721585   35.017963   27.114928   
1976-03-31     ...       36.278858   34.647570   35.737393   27.438840   
1976-04-30     ...       36.616424   34.685411   36.766017   27.719833   
1976-05-31     ...       36.935243   34.778605   37.086576   27.937016   
1976-06-30     ...       37.222773   34.776904   36.697637   28.065296   
1976-07-31     ...       37.505886   34.718738   36.507198   28.196911   
1976-08-31     ...       37.794998   34.701488   36.507497   28.374092   
1976-09-30     ...       38.028377   34.729741   36.595015   28.525929   
1976-10-31     ...       38.138147   34.790484   36.807451   28.667924   
1976-11-30     ...       38.131314   34.886907   37.108322   28.881230   
1976-12-31     ...       38.095860   35.054866   37.303658   29.192514   
1977-01-31     ...       38.107546   35.350964   37.474727   29.540404   
1977-02-28     ...       38.203612   35.781724   37.947081   29.897479   
1977-03-31     ...       38.423861   36.283095   39.045190   30.304343   
1977-04-30     ...       38.811868   36.774259   40.734923   30.768626   
1977-05-31     ...       39.357182   37.209644   41.015677   31.250531   
1977-06-30     ...       40.000423   37.627178   39.987010   31.718802   
...            ...             ...         ...         ...         ...   
2014-04-30     ...      147.110078  131.938195  149.750687  145.016658   
2014-05-31     ...      148.048576  133.059128  151.491445  146.119087   
2014-06-30     ...      148.754869  133.774886  152.950676  146.705849   
2014-07-31     ...      149.232552  134.107252  153.958918  146.915163   
2014-08-31     ...      149.582822  134.005265  154.700157  146.989397   
2014-09-30     ...      149.766985  133.980003  155.258659  147.006850   
2014-10-31     ...      149.893916  134.121209  155.562846  146.768810   
2014-11-30     ...      149.955608  133.945146  155.935939  146.409317   
2014-12-31     ...      150.022712  133.667845  156.370918  146.527718   
2015-01-31     ...      150.354085  133.828507  156.874024  147.345153   
2015-02-28     ...      151.136156  134.616780  158.024475  148.816031   
2015-03-31     ...      152.421239  135.878894  159.893825  150.660758   
2015-04-30     ...      153.838578  137.392921  161.839395  152.497640   
2015-05-31     ...      155.094103  139.000920  163.662033  154.187387   
2015-06-30     ...      156.119980  140.257899  165.361119  155.463631   
2015-07-31     ...      156.923030  140.926379  166.537058  156.262592   
2015-08-31     ...      157.468603  141.259217  166.825724  156.833480   
2015-09-30     ...      157.819092  141.518909  166.927714  157.382971   
2015-10-31     ...      158.119634  141.678581  167.349793  157.926230   
2015-11-30     ...      158.332860  141.605853  167.649963  158.314232   
2015-12-31     ...      158.557020  141.433863  167.738984  158.713564   
2016-01-31     ...      158.862737  141.563101  168.352857  159.447341   
2016-02-29     ...      159.144772  142.271182  169.904181  160.470145   
2016-03-31     ...      159.507797  143.657624  171.544114  162.069829   
2016-04-30     ...      160.123534  145.568366  173.229875  164.485491   
2016-05-31     ...      161.123521  147.264123  175.298871  166.767003   
2016-06-30     ...      162.430436  148.308823  176.893272  168.272200   
2016-07-31     ...      163.655104  149.423989  177.950783  169.529933   
2016-08-31     ...      164.685799  150.994296  178.682159  170.704408   
2016-09-30     ...      165.537323  152.106683  178.934070  171.775365   

                    VT          VA          WA          WV          WI  \
Date                                                                     
1975-01-31   26.556884   27.954539   17.480301   41.248346   28.142079   
1975-02-28   26.807912   28.230531   17.549796   42.277521   28.537453   
1975-03-31   27.050106   28.431856   17.657853   43.349320   28.927629   
1975-04-30   27.270090   28.580271   17.787585   44.454450   29.277377   
1975-05-31   27.463349   28.704849   17.904450   45.566959   29.562586   
1975-06-30   27.638171   28.825927   18.024628   46.629673   29.778909   
1975-07-31   27.786969   29.005768   18.162628   47.564471   29.944745   
1975-08-31   27.891178   29.200001   18.257222   48.313434   30.087332   
1975-09-30   27.957536   29.271384   18.276371   48.820033   30.276329   
1975-10-31   28.002721   29.229291   18.300167   49.050839   30.506126   
1975-11-30   28.028365   29.136459   18.426990   49.072358   30.668776   
1975-12-31   28.029480   29.024846   18.631743   48.992814   30.726720   
1976-01-31   28.006022   28.949221   18.845818   48.892301   30.726264   
1976-02-29   27.969583   29.012709   19.070075   48.849298   30.707069   
1976-03-31   27.950651   29.216527   19.296205   48.887318   30.727065   
1976-04-30   27.991607   29.454310   19.508391   48.941399   30.860484   
1976-05-31   28.105903   29.697488   19.741712   48.947711   31.095498   
1976-06-30   28.280967   29.905821   20.053612   48.888631   31.310072   
1976-07-31   28.496864   30.044986   20.445033   48.774808   31.464677   
1976-08-31   28.722776   30.207800   20.779096   48.648477   31.631205   
1976-09-30   28.925624   30.374140   20.967548   48.566543   31.829676   
1976-10-31   29.083661   30.486756   21.097636   48.548314   32.019483   
1976-11-30   29.202067   30.599379   21.276232   48.601173   32.242660   
1976-12-31   29.306483   30.696932   21.487053   48.755463   32.535928   
1977-01-31   29.424696   30.777994   21.644120   49.039363   32.865996   
1977-02-28   29.574836   30.910326   21.810916   49.445567   33.275297   
1977-03-31   29.772613   31.118114   22.125576   49.950923   33.781418   
1977-04-30   30.028769   31.366169   22.621918   50.541364   34.284900   
1977-05-31   30.344817   31.656930   23.163234   51.150589   34.767809   
1977-06-30   30.709720   31.993945   23.661773   51.697094   35.350264   
...                ...         ...         ...         ...         ...   
2014-04-30  160.515146  169.138464  152.187938  137.650937  119.548660   
2014-05-31  161.875803  170.731341  154.350742  138.470614  121.148730   
2014-06-30  162.938340  171.734252  156.043447  139.363821  122.402881   
2014-07-31  163.218396  171.891208  157.195348  140.335620  123.023871   
2014-08-31  162.578335  171.330539  157.373396  141.265889  122.997969   
2014-09-30  161.272823  170.516212  156.898485  141.790293  122.650383   
2014-10-31  159.707086  169.872653  156.718081  141.517479  122.142191   
2014-11-30  158.367369  169.467795  157.053266  140.571851  121.204688   
2014-12-31  157.596159  168.959114  157.373542  139.613978  120.003212   
2015-01-31  157.504410  168.329549  157.991065  139.209850  119.428768   
2015-02-28  158.118886  168.426373  159.707938  139.643743  119.936387   
2015-03-31  159.544315  169.739348  162.407389  140.923249  121.213489   
2015-04-30  161.770072  171.653057  165.353447  142.679870  122.930672   
2015-05-31  164.304970  173.503033  167.954918  144.226155  124.891490   
2015-06-30  166.245077  174.812783  170.119038  145.026587  126.324245   
2015-07-31  167.076880  175.285143  171.797675  145.087954  126.860861   
2015-08-31  166.961725  175.330590  172.745129  144.651914  126.873732   
2015-09-30  166.282498  175.200181  173.217187  143.879008  126.594458   
2015-10-31  165.307887  174.573001  173.868602  142.973366  126.366760   
2015-11-30  164.247041  173.524722  174.594670  142.006219  126.176309   
2015-12-31  163.345512  172.489851  175.123311  141.023153  125.569254   
2016-01-31  162.772990  172.224609  176.253622  140.223109  125.059323   
2016-02-29  162.604804  173.372212  178.893490  139.890822  125.552409   
2016-03-31  162.923357  175.508190  182.280465  140.298013  127.047139   
2016-04-30  163.881497  177.662737  185.456555  141.410083  128.956812   
2016-05-31  165.235066  179.538071  188.146606  142.856780  130.942732   
2016-06-30  166.682834  180.683646  190.166799  144.058204  132.794747   
2016-07-31  168.117871  180.795907  191.790489  144.654369  134.008859   
2016-08-31  169.373685  180.641917  193.140805  144.861570  134.538152   
2016-09-30  169.400854  180.218407  193.589674  144.750584  134.650743   

                    WY  
Date                    
1975-01-31   31.820164  
1975-02-28   32.277898  
1975-03-31   32.762841  
1975-04-30   33.266394  
1975-05-31   33.755117  
1975-06-30   34.212608  
1975-07-31   34.638376  
1975-08-31   35.021073  
1975-09-30   35.349940  
1975-10-31   35.601126  
1975-11-30   35.774498  
1975-12-31   35.897251  
1976-01-31   36.002504  
1976-02-29   36.135603  
1976-03-31   36.325315  
1976-04-30   36.579803  
1976-05-31   36.922370  
1976-06-30   37.389307  
1976-07-31   37.960048  
1976-08-31   38.555582  
1976-09-30   39.145237  
1976-10-31   39.741515  
1976-11-30   40.304472  
1976-12-31   40.763972  
1977-01-31   41.124995  
1977-02-28   41.449422  
1977-03-31   41.775817  
1977-04-30   42.122977  
1977-05-31   42.518585  
1977-06-30   43.014464  
...                ...  
2014-04-30  176.170184  
2014-05-31  177.523354  
2014-06-30  178.629459  
2014-07-31  179.200524  
2014-08-31  179.334276  
2014-09-30  179.364439  
2014-10-31  179.518490  
2014-11-30  179.761524  
2014-12-31  179.986943  
2015-01-31  180.265440  
2015-02-28  180.705328  
2015-03-31  181.541818  
2015-04-30  182.886627  
2015-05-31  184.576563  
2015-06-30  186.257348  
2015-07-31  187.411175  
2015-08-31  187.668120  
2015-09-30  187.197997  
2015-10-31  186.295403  
2015-11-30  185.146602  
2015-12-31  184.146732  
2016-01-31  183.681564  
2016-02-29  183.891939  
2016-03-31  184.701842  
2016-04-30  185.767732  
2016-05-31  186.626342  
2016-06-30  187.205044  
2016-07-31  187.682782  
2016-08-31  188.017950  
2016-09-30  187.743011  

[501 rows x 50 columns]
  • The same thing using pandas

In [4]:
HPI_data.to_pickle("./data/fiddy_states.pickle");
HPI_data_2 = pd.read_pickle("./data/fiddy_states.pickle");
print(HPI_data_2.head());


                   AL         AK         AZ         AR         CA         CO  \
Date                                                                           
1975-01-31  35.324038  34.400087  28.886571  36.838213  15.665713  19.666460   
1975-02-28  35.545343  34.911194  29.374322  37.149935  15.721510  19.894520   
1975-03-31  35.803942  35.434316  29.828662  37.420977  15.912556  20.118681   
1975-04-30  36.120498  35.980265  30.179479  37.642638  16.225479  20.327062   
1975-05-31  36.421849  36.576786  30.371230  37.864617  16.486814  20.497741   

                   CT         DE         FL         GA    ...             SD  \
Date                                                      ...                  
1975-01-31  24.530646  27.146975  30.903838  30.862154    ...      37.861487   
1975-02-28  25.051659  27.185646  32.121077  30.583518    ...      37.445064   
1975-03-31  25.443161  27.252283  33.931871  30.466267    ...      37.021567   
1975-04-30  25.663172  27.389022  36.149709  30.532432    ...      36.601128   
1975-05-31  25.733086  27.622613  36.433117  30.653270    ...      36.220049   

                   TN         TX         UT         VT         VA         WA  \
Date                                                                           
1975-01-31  32.210851  32.659989  24.603939  26.556884  27.954539  17.480301   
1975-02-28  32.246969  32.970745  24.947973  26.807912  28.230531  17.549796   
1975-03-31  32.329769  33.542148  25.258222  27.050106  28.431856  17.657853   
1975-04-30  32.457447  34.383316  25.504964  27.270090  28.580271  17.787585   
1975-05-31  32.606660  34.652016  25.668351  27.463349  28.704849  17.904450   

                   WV         WI         WY  
Date                                         
1975-01-31  41.248346  28.142079  31.820164  
1975-02-28  42.277521  28.537453  32.277898  
1975-03-31  43.349320  28.927629  32.762841  
1975-04-30  44.454450  29.277377  33.266394  
1975-05-31  45.566959  29.562586  33.755117  

[5 rows x 50 columns]

In [ ]: