I am using Pycharm (version 2018.2.4) with Python 3.6.7 running on it.
I currently try to use the pandas pivot function, but even the sample code:
import pandas as pd
df = pd.DataFrame({'foo':['one', 'one', 'one', 'two', 'two','two'],'bar':
['A', 'B', 'C', 'A', 'B', 'C'],'baz': [1, 2, 3, 4, 5, 6],'zoo': ['x',
'y', 'z', 'q', 'w', 't']})
df.pivot(index='foo', columns='bar', values=['baz', 'zoo'])
leads to the error: Exception: Data must be 1-dimensional
This is only the case when I pass a list of columns to the values parameter, however this example is taken straight from the function help: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pivot.html
It used to work for me in the past and has stopped working this week, not sure why. My pandas version is 0.23.4 and numpy version is 1.15.4.
Does anybody know what is causing this/how to fix it?
Thanks!