I once again need your help. I have to change the IDs in my dataset in a rather weird way, but it is, what it is. Now let me show you a line of my dataset:
number timestamp id x y
20681 1 12 1 2.035 14.378
I´m locating each line by 'number' with this line of code:
select_number = data_cleaning_sortable.loc[data_cleaning_sortable['number'] == 1]
After that I want to replace the id in the given line with a certain value. The problem is I don´t know the value of the id, since I´m trying to automate this process for the whole dataset. So I really just want to call the label of the column instead of the value. I´ve tried this:
new = select_number.replace(['id'], 4)
But it doesn´t work. I´ve searched a while on stackoverflow, but I couldn´t find anyone with the same problem. Maybe a good soul here can help me out. Thanks in advance.
EDIT: This i what it looks like before editing:
number timestamp id x y
94540 768 0 10.989 17.986
94541 780 0 10.507 18.147
94542 792 0 10.278 18.491
94543 804 0 9.980 18.812
94544 816 0 9.291 18.996
This is what it should look like after editing:
number timestamp id x y
94540 768 1 10.989 17.986
94541 780 1 10.507 18.147
94542 792 1 10.278 18.491
94543 804 1 9.980 18.812
94544 816 1 9.291 18.996