0
I have a code that eliminates values as needed, but I’m not able to put an interval to delete or keep the value. For example, I want values between 7:00 and 5:00.
If you put values greater than 18h, it accepts, but not both conditions at the same time. Follow the code:
import pandas as pd
dataset = pd.read_csv('/home/Downloads/Dados_PNBoia/boia_deriva/B116353_col_2018.csv')
type(dataset)
df = pd.concat([dataset], ignore_index=True)
df = dataset.loc[(dataset[' hour'] > 18) & (dataset[' hour'] < 6)]
df.to_csv('/home/Downloads/Dados_PNBoia/boia_deriva/B116353_col_2018_noite.csv')
Someone knows how to fix?
P.S.: I know that in the case I put the symbol &
, and in case it would be OR
, but the same does not accept, says that:
'The Truth value of a Series is ambiguous'.