Skip to content

Tag: pandas

Filter Nulls when converting pandas dataframe to dict

I have this pandas dataframe. I am interested to convert every row into a dict. So i use the above function and this trick But the result i get is weird. The last row had Language and Discount both as Nan. And i expected that both should have been filtered out but i see only Language is filtered out. How

Pandas: str.extract() giving unexpected NaN

I have a data set which has a column that looks like this I need only the numbers. Here’s my code: I was expecting an output like: but I got Just to test, I dumped the dataframe to a .csv and read it back with pd.read_csv(). That gave me just the numbers, as I need (though of course that’s not