Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace ? by 0
#7
Hi again Matador,

The Code I gave you, will change all '?' in the 'age' Column.

But I realised there is a shorter way, to get the change you wanted.

You said you wanted to change, the '?' in the 'age' Column at Index 15 to '0'

So using .loc you can change, the '?' to '0' at that specific Row and Index, and not change other '?' in the other Rows, in the 'age' Column if they were present.

Therefore using the following Line of Code, should also work :-

test.loc[15,'age']='0'
Could you let me know, if that also works for you ?

Best Regards

Eddie Winch Smile
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