I have a huge data framework and I index it like this:
df.ix[<integer>]
Depending on the index, sometimes it will be only one row of values. Pandas automatically converts this to a series, which, frankly, is annoying because I can't work on it the same way I can df.
Like me:
1) Stop Pandas from converting and save it as a data block?
OR
2) is it easy to convert the resulting series back to a data frame?
pd.DataFrame(df.ix[<integer>]) does not work because it does not preserve the original columns. It treats <integer> as a column, and columns as indices. Very grateful.
source share