I want to replace multiple strings with a single string in a list. Reference: Find and replace string values in list
cols = ['M23group','M23met_event', 'M23mode', 'M23validation_1min', 'M23validation_2min', 'M23voltage',
'M24AmbientAir_Av', 'M24Efficiency', 'M24FF', 'M24Impp', 'M24Isc',]
cols = [w.replace('M23'|'M24', 'M') for w in cols]
Present output:
TypeError: unsupported operand type(s) for |: 'str' and 'str'