I have a dataframe of 51077 rows × 4 columns. I need to subset a dataframe with the rows with values > 0.3 and < -0.3 in the third column.
I used the following:
df_filtered = df[np.logical_and(df["third column"] > 0.3, df["third column"] < -0.3)]
But the result showed only the columns'names
I also tried:
df_filtered = df.query("third column < -0.3 & third column > 0.3")
But the result was the same.
How do I resolve this?