import numpy as np
import pandas as pd
a = np.array([["M", 86],
["M", 76],
["M", 56],
["M", 66],
["B", 16],
["B", 13],
["B", 16],
["B", 18],
["B", 14], ])
df = pd.DataFrame(data=a, columns=["Case", "radius"])
print(df)
print(df.columns)
a = df[(df["radius"] >= 57) & (df["Case"] == "M")]["radius"].tolist()
print(a)
I get an error - TypeError: '>=' not supported between instances of 'str' and 'int' But here i am putting a condition on a column that contains integers. What is the problem here? i want to have a list of column radius values where the values of column radius are greater than or equal to 57 and "Case"=="M