This is my code,
import plotly.plotly as py
import datetime
import pandas
import matplotlib.pyplot as plt
import pandas.io.data as pd
start = datetime.datetime(2016, 2, 1)
end = datetime.datetime(2016, 2, 11)
#raw = pd.DataReader("tjx", "yahoo", start, end)
rawy = pd.DataReader("tjx", "yahoo", start, end)['Low']
print rawy
print "========================"
columns = ['Low']
newDf = pd.DataFrame(columns=columns)
newDf = newDf.fillna(0)
#newDf[0] = rawy[0]
#newDf[0:1] = rawy[0:1]
#newDf.loc[0] = rawy.loc[0]
newDf.loc[0] = rawy[0]
print newDf
The result is like this,
Date
2016-02-01 70.470001
2016-02-02 72.309998
2016-02-03 71.000000
2016-02-04 69.720001
2016-02-05 67.900002
2016-02-08 66.820000
2016-02-09 67.519997
2016-02-10 69.279999
2016-02-11 67.410004
Name: Low, dtype: float64
========================
Low
0 70.470001
If you look at the last line of result, it's using 0 as index, not date from the original data frame. So how to correct this please ?