I've a PandaDataframe that contains information about many orders that are placed and their times. This data is for a restaurant that is functional from 11:00 am - 1:00 am.
The name of the dataFrame is "DfPayments".
It has two columns DfPayments['hour'] and DfPayments['day'] which contain information on the day and the hour that the order was placed on. When summing up the days sales some orders that are placed after midnight are counted in the next days sales. Hence, I want to create a new variable for hour and use it to adjust the sales accordingly. However, when i use the following code I get an error.
if DfPayments['hour'] == 0:
DfPayments['newhour'] = DfPayments['newhour'] - 1
the error is:
---> 18 if DfPayments['hour'] == 0: 19 DfPayments['newhour'] = DfPayments['newhour'] - 1
1574 raise ValueError("The truth value of a {0} is ambiguous. " 1575 "Use a.empty, a.bool(), a.item(), a.any() or a.all()." -> 1576 .format(self.class.name)) 1577 1578 bool = nonzero