CHANGE COLUMN DTYPE | How to change the datatype of a column in Pandas (2020)

preview_player
Показать описание
An overview of the methods used to change the dataype of a Pandas column in Python. In other words, we review how to change the column type in Pandas. How to change the value of a column in pandas. Sometimes the datatype of a column is not always what we want it to be. When our column datatype is incorrect it can cause problems because we may be limited in the operations and methods that are available to us. In this video we discuss various methods on how to convert string columns to integers and floats and vis versa. We discuss how to convert columns to datetime in another video.

Consider subscribing for weekly tips, tricks, and tutorials.

Convert to Datetime

Chapters
0:00 Intro
1:04 Data overview
1:49 string to int/float
3:55 convert w/ round
4:44 Mixed types
5:45 to_numeric
8:20 mixed to_numeric
10:40 money cols
Рекомендации по теме
Комментарии
Автор

Thank you! I've watched a lot of videos, but it was yours that helped me at a certain point👍

michaelmiachel
Автор

The best video...i was searching in so many videos here and thanks to you I'm done:) MANY

bryanparis
Автор

Explanation with rationale as to why we do it a certain way is exemplary

amaanraza
Автор

It's a nicely explained tutorial. 👍

mahboobalam
Автор

Hi, thank you! I have a problem while trying to convert 'missing' to int I have this error (IntCastingNaNError: Cannot convert non-finite values (NA or inf) to integer). Also my vs Code ipynb file won't recognise Int64:

Dikano
Автор

Hello, I just want to ask what to do if a dataframe is displaying 1, 500 even if the value on the excel is 1, 500.00

unknown
Автор

can anyone explain at money col he replaces everything with empty string but i have loss which is indicated by - how can i keep the - sign for indicatiing loss and change its type to nu[meric ??

darksider
Автор

really helpful bro... thanks for creating this video

mr.sakshamjolly
Автор

How to find out which of the columns are having a datatype object and convert them to string type ...i mean not specifically mentioning the column name..but by iterating and taking them automatically...PLS REPLY

arunimav
Автор

Thanks so much it is very informative.

abdelrhmansayed
Автор

Can you share the link to the video for converting column to datetime? It's not in your descriptions

miketruong
Автор

It is not working with any of your suggestions please help

honest_review
Автор

You completely skipped over the only column I cared about (missing) by saying "now we should be fully equipped to deal with this on our own".

Abysmal tutorial and teacher.

QuietPenguinGaming