Python Forum
Converting Dataframe in Python from Object to Float
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting Dataframe in Python from Object to Float
#1
Hi there,
i am pretty new to python and i have a dataframe with object types (see image below). Those are supposed to be prices of financial assets, and (e.g.) are in the form of 13,754.34 . At the moment they are object but i need to convert into float otherwise can’t do any operation with it (i mainly need to plot those series and calculate correlation).
I tried astype , i tried to_numeric and so on but none of those work.
Can anybody help me to fix it please? Many thank in advance.

[Image: a6ce1be1585a0ed193aa5220ea5c77d7f9d8c018_2_1380x794.png]
Reply


Messages In This Thread
Converting Dataframe in Python from Object to Float - by marco_ita - Aug-28-2019, 03:59 AM
I am getting error in this code - by AnkitGupta - Jan-08-2020, 04:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  converting dataframe to int numpy array glennford49 1 2,346 Apr-04-2020, 06:15 AM
Last Post: snippsat
  Converting string the pandas dataframe chrismc 0 2,372 Jan-24-2019, 11:07 AM
Last Post: chrismc
  Converting Flattened JSON to Dataframe in Python 2.7 ManMan 1 5,301 Jul-12-2017, 06:52 PM
Last Post: ManMan
  The problem of converting string to float by using CSV file CChen 2 12,974 Jul-11-2017, 03:32 PM
Last Post: CChen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020