I have 2 columns in excel. I get an error from simply dividing them with pandas. What am I doing wrong?
import pandas as pd
import numpy as np
df = pd.read_excel('day.xlsx', sheet_name = 'day1')
df=pd.DataFrame(df)
df=df.rename(columns={0: 'Time', 'null': 'Temp', 'null.1':'Pressure'})
df['ratio']=df['Temp']/df['Pressure']
I am trying to create a third column 'ratio' from dividing 'Temp' with 'Pressure'.
Error message:
TypeError: unsupported operand type(s) for /: 'float' and 'str'