Search code examples
pythonblender-2.61

How do I use Regex to remove "Sensor_" from a data set? this is example set, ["Sensor_01", "Sensor_10"}


How do I use Regex to remove "Sensor_" from a data set? this is example set, ["Sensor_01", "Sensor_10"}

??

I am having some trouble with understanding all the symbols, (dyslexia)


Solution

  • like this:

    dataset = ['Sensor_01', 'Sensor_02', 'Sensor_03']
    for i in range(len(dataset)):
        dataset[i] = dataset[i].replace('Sensor_', '')
    print dataset