pandas.Series.astype
Series.astype(self: ~ FrameOrSeries, dtype, copy: bool = True, errors: str = 'raise') → ~FrameOrSeries[source]
Cast a pandas object to a specified dtype dtype.
Parameters
dtype data type, or dict of column name - data type
Use a numpy.dtype or Python type to cast entire pandas object to the same type. Alternatively, use {col: dtype, …}, where col is a column label and dtype is a numpy.dtype or Python type to cast one or more of the DataFrame’s columns to column-specific types.
copy bool, default True
Return a copy when copy=True (be very careful setting copy=False as changes to values then may propagate to other pandas objects).
errors{‘raise’, ‘ignore’}, default ‘raise’
Control raising of exceptions on invalid data for provided dtype.
raise : allow exceptions to be raised
ignore : suppress exceptions. On error return original object.
Returns
casted same type as caller
The github link for this video is below 👇👇
https://github.com/RakeshKrishna143/P...
Watch video How to change the data types of a Pandas Series ? | Pandas astype | Pandas tutorial for Beginners online without registration, duration hours minute second in high quality. This video was added by user Engineers Revolution 24 July 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 274 once and liked it 6 people.