I have 2 dataframes, representing the estimate mean and standard error.
import numpy as np
import scipy.stats as st
rows = (1, 2)
col1 = ["mean_x", "mean_y"]
col2 = ["std_x", "std_y"]
data1 = ([10, 20], [5, 10])
data2 = ([1, 2], [0.5, 1])
df1 = pd.DataFrame(data1, index = rows, columns = col1)
df2 = pd.DataFrame(data2, index = rows, columns = col2)
I want to manipulate these 2 dataframes elementwisely, to construct a dataframe of confidence interval at 95% level
The ideal format is
Running a loop seems to be awkward, I am wondering if there is any method that is more elegant, efficient?