Python Forum
Error could not convert string to float:
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error could not convert string to float:
#5
You can track down which items produce the error. Replace the last line with:

try:
    member_clean['AverageCheckingBalance'] = member_clean['AverageCheckingBalance'].astype(float)
except ValueError:
    print(repr(member_clean['AverageCheckingBalance'])
That will print all of the values causing an error.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Error could not convert string to float: - by ichabod801 - Oct-02-2019, 05:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  string to float conversion fails PetarPetrenko 10 1,384 Feb-29-2024, 04:20 PM
Last Post: deanhystad
  fixing error TypeError: 'float' object is not subscriptable programmingirl 1 1,603 Jan-28-2023, 08:13 PM
Last Post: deanhystad
  Convert multiple decimal numbers in string to floats Katy8 6 3,673 Aug-16-2020, 06:06 PM
Last Post: Katy8
  how to convert list into string Shevach 3 2,687 May-14-2019, 09:51 AM
Last Post: perfringo
  Convert string to a specific number of bytes artblinked 1 2,482 Mar-28-2019, 08:43 PM
Last Post: Larz60+
  ValueError: could not convert string to float: 'Pencil' Balakay97 3 5,993 Mar-08-2018, 07:30 PM
Last Post: sparkz_alot
  How to convert boolean "True" to custom string? student8 3 12,716 Oct-01-2017, 06:24 AM
Last Post: hbknjr
  pandas convert to tuple & float to float64 metalray 6 17,886 Feb-27-2017, 12:50 PM
Last Post: metalray

Forum Jump:

User Panel Messages

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