I have a pandas dataframe that looks something like this:
myid user start end
a tom 2023-01-01T23:41:32 2023-01-02T23:41:32
b dick None 2023-01-05T20:41:32
c harry 2023-01-01T23:41:32 2023-01-03T21:41:32
d sally None 2023-01-05T03:41:32
I am trying to replace the values of df["start"] which are equal to "None" with the respective value of df["end"] for that row entry:
myid user start end
a tom 2023-01-01T23:41:32 2023-01-02T23:41:32
b dick 2023-01-05T20:41:32 2023-01-05T20:41:32
c harry 2023-01-01T23:41:32 2023-01-03T21:41:32
d sally 2023-01-05T03:41:32 2023-01-05T03:41:32
This doesn't seem to work:
df[df["start"]=="None"]["start"]=df[df["start"]=="None"]["end"]
The entries with "start"== "None" remain unchanged.
Is there a simple way to achieve this?