Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace ? by 0
#1
Hello to everyone,

I have a panda dataframe with many columns, one of them contains the ages of clients but when the age is unknown, I have ?. I'd like to replace the ? by 0. In index 15, the age is unknown.

test.fillna(value={"age": 0}).age.head(16)
test is the name of my dataframe and i'm displaying the first seventeenth values, i don't have an error message but nothing changes and ? is still in index 15. Do you know why?
Reply


Messages In This Thread
Replace ? by 0 - by matador - Aug-22-2020, 08:44 PM
RE: Replace ? by 0 - by eddywinch82 - Aug-22-2020, 10:42 PM
RE: Replace ? by 0 - by matador - Aug-23-2020, 11:40 AM
RE: Replace ? by 0 - by eddywinch82 - Aug-23-2020, 02:00 PM
RE: Replace ? by 0 - by matador - Aug-23-2020, 02:55 PM
RE: Replace ? by 0 - by eddywinch82 - Aug-23-2020, 03:26 PM
RE: Replace ? by 0 - by eddywinch82 - Aug-25-2020, 12:23 AM

Forum Jump:

User Panel Messages

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