I know this should be really easy but I keep getting errors when trying to pivot. I'm getting my data from psycopg2
cur.execute("select * from table")
arr=cur.fetchall()
pdres=pandas.DataFrame(arr, columns=['pricedate',hour', 'node','dart'])
pdres=pdres.set_index(['pricedate','hour','node'])
Here is where stuff stops working...
pdres.pivot(index=['pricedate','hour'],columns='node',values='dart')
results in Wrong number of items passed 720, placement implies 2
That brought me to this question which led me to doing this
pandas.pivot_table(pdres, index=['pricedate','hour'], columns='node', values='dart')
This tells me 'No numeric types to aggregate
That led me to http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.convert_objects.html but I'm not sure the right syntax of it (when to use it), and I also don't even know if I'm on the right track.