Could you, please, help me to crack the calculation?
I have the following table:
What I need to do is to calculate the expected frequency as (row total * col total) / grand total
I assume that I need to iterate through rows and columns. I have tried to do it with:
for i, row in df_dropped.iterrows():
for j, column in row.iteritems():
data[row][column] = df_dropped.iloc[i, 3] * df_dropped.iloc[2, j]
The error appears: Location based indexing can only have [integer, integer slice (START point is INCLUDED, END point is EXCLUDED), listlike of integers, boolean array] types
What am I doing wrong?

