I have a doubt regarding this code and I don't know if I'm selecting correct the dataframe:
if (df_total[(df_total["name"] == "STREET 292") & (df_total["free_motobikes"] != 0) & (df_total["HOUR"] == 7) & (df_total["MINUTES"]<= 50)]):
print("User can take a motobike at STREET 292 by aprox. 7:50 am ")
elif (df_total[(df_total["name"] == "STREET 6") & (df_total["empty_slots"] != 0) & (df_total["HOUR"] <= 8)]):
print("User can park the motobike at AV. DE LA CATEDRAL, 6 by aprox 8:00 am")
else:
print("User cannot take a motobike neither park it")
Output:
ValueError
def __nonzero__(self):
1537 raise ValueError(
\-\> 1538 f"The truth value of a {type(self).__name__} is ambiguous. "
1539 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
1540 )
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I want that the program check both conditions in order to know if the user could take a motorbike in this frame of time.