flights['Duration']=flights['Duration'].str.replace('h','*60').str.replace(' ','+').str.replace('m','*1').apply(eval)
However I am getting this error message:
AttributeError Traceback (most recent call last)
<ipython-input-24-45eafc3e9d23> in <module>()
----> 1 travel['Duration']=travel['Duration'].str.replace('h','*60').str.replace(' ','+').str.replace('m','*1').apply(eval)
2
3 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/strings.py in _validate(data)
1965
1966 if inferred_dtype not in allowed_types:
-> 1967 raise AttributeError("Can only use .str accessor with string " "values!")
1968 return inferred_dtype
1969
AttributeError: Can only use .str accessor with string values!