0

data looks like;

    day value
1    X1   52
2    X2   62
3    X3   44
4    X4   30
5    X9   10

I want to delete 'X' from all observations below the day variable in this dataset. So just keep the numbers. how can I do that?

Code for R= str.remove.all(data$day, "X")

what about python code for same operation?

M--
  • 25,431
  • 8
  • 61
  • 93

1 Answers1

0

problem solved.thanks

 data['day'] =data['day'].map(lambda x: x.lstrip('X'))