6

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
Rahul
  • 325
  • 5
  • 11

1 Answers1

7

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)
Kallol
  • 2,089
  • 3
  • 18
  • 33