I have a pandas df as below :
+------+----+
| x | y |
+------+----+
|ABCD | - |
|DEFG | - |
+------+----+
with data types of x and y being object, after replacing the '-' with nan using the below
df = df.replace('-', np.NaN)
It converts the data type of column y as float while the data type of column y is expected to remain as object. Also when I try to find out the list of columns having NA values after replacing with NA values it doesn't show any columns having NA values whereas the column y has NA values. Why is the issue being caused?
EDIT : I'm able to find the columns having NA values as below
df.columns[df.isna().any()].tolist()