I am having trouble list
of lists
to pandas
DataFrame.
here is my data:
list_of_lists = np.array(hazard)
[['13-06-2016' '2.0' '1.0' '3.0' '88.0' '0.0' '72.0' '7.27']
['18-06-2016' '1.0' '0.0' '3.0' '85.5' '0.0' '77.0' '8.05']
['22-06-2016' '3.0' '0.0' '5.0' '91.5' '0.0' '66.0' '7.54']
['26-06-2016' '3.0' '2.0' '4.0' '89.6' '1.0' '74.0' '10.0']
['01-07-2016' '3.0' '0.0' '1.0' '88.9' '0.0' '72.0' '6.75']
['27-08-2016' '7.0' '4.0' '2.0' '81.8' '2.0' '91.0' '8.79']
['01-09-2016' '0.0' '0.0' '1.0' '59.3' '1.0' '46.0' '6.92']
['11-09-2016' '2.0' '1.0' '4.0' '91.7' '0.0' '71.0' '6.84']
['16-09-2016' '0.0' '0.0' '1.0' '81.8' '1.0' '68.0' '7.07']
['24-09-2016' '2.0' '0.0' '1.0' '84.2' '0.0' '52.0' '6.11']
['30-10-2016' '3.0' '3.0' '5.0' '83.0' '1.0' '72.0' '8.87']
['05-11-2016' '3.0' '3.0' '1.0' '94.6' '0.0' '75.0' '9.76']
['09-11-2016' '1.0' '1.0' '4.0' '92.1' '0.0' '84.0' '7.21']
['20-11-2016' '0.0' '0.0' '5.0' '84.6' '1.0' '92.0' '8.27']
['26-11-2016' '2.0' '1.0' '1.0' '81.8' '0.0' '46.0' '7.19']
['26-12-2016' '5.0' '2.0' '4.0' '85.7' '1.0' '87.0' '10.0']
['31-12-2016' '2.0' '1.0' '5.0' '86.0' '1.0' '65.0' '7.78']
['04-01-2017' '2.0' '0.0' '1.0' '83.6' '1.0' '81.0' '6.07']]
and I have a pandas
dataframe that I have constructed as
player_df = pd.DataFrame(columns=['Date', 'Total Shots', 'On Target',
'Key Passes', 'Passing Accuracy', 'Aerials Won',
'Touches', 'WhoScored Rating'])
now when I try player_df.append(list_of_lists)
I get,
TypeError: cannot concatenate a non-NDFrame object.
can someone tell me what is going wrong here? the length of the lists matches with the number of columns here so surely it should be fine?