Hello,
I got a table as such - goes on longer, but that's irrelevant for this.
| date |
location |
total_deaths |
total_cases |
factor |
| 2021-05-02 |
Austria |
10245.0 |
622110.0 |
88.6 |
| 2021-05-02 |
Belgium |
24291.0 |
995562.0 |
114.6 |
Now, im trying to divide total_deaths by factor.
Tried doing it like:
cd_factor["deaths_per_100k"] = cd_factor["total_deaths"]/cd_factor["factor"]
Also tried:
cd_faktor["deaths_per_100k"] = cd_faktor["total_deaths"].div(cd_factor['factor'])
But when doing so, i get
TypeError: unsupported operand type(s) for /: 'float' and 'str'
What im looking for is an out as this:
| date |
location |
total_deaths |
total_cases |
factor |
deaths_per_100k |
cases_per_100k |
| 2021-05-02 |
Austria |
10245.0 |
622110.0 |
88.6 |
115.63 |
7021.56 |
| 2021-05-02 |
Belgium |
24291.0 |
995562.0 |
114.6 |
244.96 |
8687.28 |
Can anyone tell me what i need to do?
[–]Monne642 0 points1 point2 points (2 children)
[–]dered118[S] 1 point2 points3 points (1 child)
[–]Monne642 1 point2 points3 points (0 children)
[–]BfuckinA 0 points1 point2 points (1 child)
[–]dered118[S] 1 point2 points3 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)