Feb-10-2020, 11:48 PM
(This post was last modified: Feb-10-2020, 11:48 PM by eddywinch82.)
Hi there,
I have an Traceback Error, associated with the following line, of the Python Code I have :-
Also I meant to say, I had an ')' bracket around the 'Venue' part of the Code, so saying :-
Any help would be appreciated
Regards
Eddie Winch
I have an Traceback Error, associated with the following line, of the Python Code I have :-
groupby_venue_date = selected.groupby(['Venue', 'BID', 'Date', 'DISPLAY/', 'Durn-Total'])Which gives the following Traceback Error :-
Error:File "<ipython-input-278-b2b43ed053c7>", line 47
groupby_venue_date = selected.groupby(['Venue', 'BID', 'Date', 'DISPLAY/', 'Durn-Total'])
^
SyntaxError: invalid syntax
It is proceeded by the following Line of Code :-df['Durn-Total'] = df['Durn'].groupby(df['Venue'].sum()With that line of Code, I am trying to Group the DataFrame Data, by the Column 'Venue', and Sum by the 'Durn' Row, creating a new Column 'Durn-Total' is that correct ? I was wondering if that line is causing the Error I am getting ? Could Someone suggest to me, what is causing the Error ?
Also I meant to say, I had an ')' bracket around the 'Venue' part of the Code, so saying :-
df['Durn-Total'] = df['Durn'].groupby(df['Venue']).sum()But that gave an Traceback Error Of :-
Error:TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.time'
And I am unsure, how to fix that Error in Code. I am assuming it's because calculations, can't be done, in the Time Format, the Values in the 'Durn' Column are, at that point in the Code ?Any help would be appreciated
Regards
Eddie Winch