I have a Pandas dataframe called output. The basic issue is that I would like to set a certain row, column in the dataframe to a list using the ix function and am getting ValueError: setting an array element with a sequence. My understanding is that a dataframe element was like a list element, it could hold anything (string, list, tuple, etc). Am I not correct?
Basic setup:
import pandas as pd
output = pd.DataFrame(data = [[800.0]], columns=['Sold Count'], index=['Project1'])
print output.ix['Project1', 'Sold Count']
# -> 800
works fine:
output.ix['Project1', 'Sold Count'] = 400.0
print output.ix['Project1', 'Sold Count']
# -> 400.0
doesn't work:
output.ix['Project1', 'Sold Count'] = [400.0]
# -> ValueError: setting an array element with a sequence.
[400.0, 200.0]