Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the datatype of column in dask dataframe?

I have a column in my dask dataframe whose datatype is integer I want to change it to a float datatype, how can I do such an operation.

fid_price_df.head(3)

    fid selling_price
0   98101   439.00
1   67022   419.00
2   131142  299.00

In the above dask dataframe I need to change the 'fid' column into float datatype.

>>>type(fid_price_df)
dask.dataframe.core.DataFrame
like image 791
Rahul Avatar asked Nov 23 '19 06:11

Rahul


1 Answers

try this:

fid_price_df['column_name_you_want_to_convert']=fid_price_df['column_name_you_want_to_convert'].astype(float)

so in this case,

fid_price_df['fid']=fid_price_df['fid'].astype(float)
like image 143
Kallol Avatar answered Oct 02 '22 22:10

Kallol