In [3]:
import pandas as pd;

In [7]:
df = pd.read_csv("./data/ZILL-Z77006_MLP.csv");
print(df.head());


         Date     Value
0  2015-02-28  620000.0
1  2015-01-31  620000.0
2  2014-12-31  629000.0
3  2014-11-30  632500.0
4  2014-10-31  619900.0

In [8]:
df.set_index("Date", inplace=True);
print(df.head());
df.to_csv("./data/z77006_mlp_new.csv");


               Value
Date                
2015-02-28  620000.0
2015-01-31  620000.0
2014-12-31  629000.0
2014-11-30  632500.0
2014-10-31  619900.0

In [18]:
df = pd.read_csv("./data/z77006_mlp_new.csv", index_col=0);
df.columns = ["Austin_HPI"];
print(df.head());
df.to_csv("./data/z77006_mlp_no_header.csv", header=False);


            Austin_HPI
Date                  
2015-02-28    620000.0
2015-01-31    620000.0
2014-12-31    629000.0
2014-11-30    632500.0
2014-10-31    619900.0

In [22]:
df = pd.read_csv("./data/z77006_mlp_no_header.csv", names=["Date", "Austin_HPI"])
print(df.head());


         Date  Austin_HPI
0  2015-02-28    620000.0
1  2015-01-31    620000.0
2  2014-12-31    629000.0
3  2014-11-30    632500.0
4  2014-10-31    619900.0

In [29]:
df = pd.read_csv("./data/z77006_mlp_no_header.csv", names=["Date", "Austin_HPI"], index_col=0)
print(df.head());


            Austin_HPI
Date                  
2015-02-28    620000.0
2015-01-31    620000.0
2014-12-31    629000.0
2014-11-30    632500.0
2014-10-31    619900.0

In [30]:
df.to_html("./data/z77006_mlp_no_header.html"); #to html <table>

In [33]:
df.rename(columns={"Austin_HPI":"77006_HPI"}, inplace=True); # Have you thinked that this should be a function?
print(df.head());


            77006_HPI
Date                 
2015-02-28   620000.0
2015-01-31   620000.0
2014-12-31   629000.0
2014-11-30   632500.0
2014-10-31   619900.0

In [ ]: