filmov
tv
Update pandas data types // Change data types of multiple columns with Python pandas astype
Показать описание
Change the data types of your Python pandas dataframes and series columns using pandas astype method. This video from my "Pandas Tips" series demonstrates how you can use Python pandas astype to recast your columns or dataframes from one data type into another. First, we change the current data types of our dataframe using the pandas dtypes property. I'll show you how to update the data types of your entire dataframe first, then we'll use astype to change each column value from an integer into a float. Level up your skills by leveraging the pandas astype mapper. This dictionary-like object allows you to submit the column name as the key and the data type you want as the value. Then you can change the data types of multiple columns at once with just one call to the astype method -- all by supplying a Python pandas mapper object. We do this to convert one column into floats and two others into Boolean data types. You can also make your astype changes permanent by overwriting your pandas dataframe, which we do at the end of the video. Check out this pandas tutorial video to improve your Python pandas knowledge and make the most out of the pandas astype method for changing the data types of your pandas objects!
0:00 Introduction
0:34 Set up and load data
1:09 .dtypes
1:29 Change entire dataframe
2:19 Change one column
3:31 Level UP! mapper
4:50 Multiple columns, different data types
6:33 Permanent changes
7:02 Conclusion & bloopers
💻 Github CODE 💻
🎥 Related VIDEOS 🎥
📖 BOOKS about pandas from my Amazon Storefront 📖
☕ Buy me a COFFEE ☕
If you have enjoyed the content presented in this video and are able, consider buying a virtual cup of coffee to keep my channel going!
#python #pandas #pythonprogramming
0:00 Introduction
0:34 Set up and load data
1:09 .dtypes
1:29 Change entire dataframe
2:19 Change one column
3:31 Level UP! mapper
4:50 Multiple columns, different data types
6:33 Permanent changes
7:02 Conclusion & bloopers
💻 Github CODE 💻
🎥 Related VIDEOS 🎥
📖 BOOKS about pandas from my Amazon Storefront 📖
☕ Buy me a COFFEE ☕
If you have enjoyed the content presented in this video and are able, consider buying a virtual cup of coffee to keep my channel going!
#python #pandas #pythonprogramming
Комментарии