I have a pandas dataframe of 4000 rows and 35 features, in which some of the continuous features contain missing values (NaNs). For example, one of them (with 46 missing values) has a very left-skewed distribution and I would like to binarize it by choosing a threshold of 1.5 below which I would like to set it as the class 0 and above or equal to 1.5 as the class 1.
Like: `X_original = [0.01,2.80,-1.74,1.34,1.55], X_bin = [0, 1, 0, 0, 1].`

I tried doing: `dataframe["bin"] = (dataframe["original"] > 1.5).astype(int)`.
However, I noticed that the missing values (NaNs) disappeared and they are encoded in the 0 class.

How could I solve this problem?