Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13891

pd.DataFrame.eq() not returning the expected ouput

$
0
0

I am working with the ames-iowa-housing-dataset and tried to find the null values in the categorical columns usign the the following code:

(data  .select_dtypes('string')  .eq('NA')   # equals an empty string  .mean(axis='rows')  .mul(100)  .pipe(lambda ser: ser[ser > 0]))

It outputs an empty series:

Series([], dtype: double[pyarrow])

It shouldn't be this as the 'Alley' column contains NA values.

I tried replacing the empty string('') with None, but it didn't work.


Viewing all articles
Browse latest Browse all 13891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>