I have two pandas dataframes that are the same length and width. I want to find the %CV between each cell of the two dataframes (or the standard dev and mean, and then I can calculate CV by hand).
For example, if I have something like this:
A B C
0 1 2 3
1 4 5 6
2 7 8 9
and
A B C
0 3 2 1
1 6 5 4
2 9 8 7
I want to return one dataframe containing the standard deviation/mean/CV between A1 in the first dataframe and A1 in the second dataframe.
Example (mean):
A B C
0 2 2 2
1 5 5 5
2 8 8 8
I want the same for standard deviation and then to calculate %CV via standard deviation / mean.
I have tried converting the dataframes to numpy
stan_dev = np.dstack((arr1.to_numpy(), arr2.to_numpy())).std(axis=2)
but I get this error:
TypeError: loop of ufunc does not support argument 0 of type float which has no callable sqrt method
Thank you!