MENU

Fun & Interesting

NaN vs. NA — understanding Pandas nullable types

Python and Pandas with Reuven Lerner 3,551 lượt xem 1 year ago
Video Not Working? Fix It Now

Why does Pandas change the dtype when you set something to NaN? What's pd.NA, and how is it different from the traditional np.NaN? And how can we enforce dtypes, rather than have them change automatically?

In this video, I explain what happens in NumPy, how Pandas is different, and how Pandas is changing to use nullable integer and string types. You'll also see how you can take advantage of these new types in your own data projects.

The Jupyter notebook I used here, along with all notebooks from my YouTube videos, is at https://github.com/reuven/youTube-notebooks.

And if you're a Pandas user, you should check out my weekly Pandas challenges about current events at https://BambooWeekly.substack.com.

Comment