3 ms·
Slightly off-topic, I have been occasionally trying to learn to use pandas, but having worked quite a lot with SQL, there is one thing that I can't get over. Is
by beefield 7y ago
Slightly off-topic, I have been occasionally trying to learn to use pandas, but having worked quite a lot with SQL, there is one thing that I can't get over. Is there a way to force pandas to have same data type for each element in a column? (Especially pandas seems to think that NaN is a valid replacelemnt of None, and after that you really can't trust anything to run on a column because the data types may chnage.
Or then, more likely, I have missed some idiomatic way to work with pandas.
- TheGallopedHigh 7y agoOff the top of my head there is an as_type method to set a column to a type. You can also choose how to fill None values, namely what value you want instead. See fill_na function