0
Dataframes, pandas and computed columns - please point out the error
1 Answer
+ 1
import pandas as pd
data = pd.read_csv("/usercode/files/ca-covid.csv")
df = pd.DataFrame(data)
newdf= df.assign(ratio = df["deaths"]/df["cases"])
#Or: newdf = df.assign(ratio = df.deaths/df.cases)
print(newdf)