The following code snippet
df = pandas.DataFrame({})
for run in range(3):
df[str(run)] = pandas.Series([1,2])
produces an empty dataframe (instead of three columns of [1,2], indexed by 0, 1, 2). Why, and how do I fix this?
More precisely, this is what is output by pandas version 0.11 (run in ipython with Python 2.7):
In [17]: df
Out[17]:
Empty DataFrame
Columns: [0, 1, 2]
Index: []