Ive found the variance and the mean of the columns that contain a float. Below prints out just that, but I want it to print out as the following below. train_1 float columns ['Age', 'RestingBP'].
variance of Age is 0.03595686694781368 mean of age is: 0.4641151293344085 variance of RestingBP 0.006797712487953147 mean of RestingBP: 0.6499696048632219
How do I do that and can I save this as a set/list to later use it in a formula.
I want to be able to identify which mean and variance goes with each columns, so that later i can potentially multiply the values.
numerical = [var for var in train_1.columns if train_1[var].dtype=='float64']
for var in numerical:
variance1 = variance(train_1[var])
mean1 = statistics.mean(train_1[var])
print(f"variance {numerical}" , variance1)
print("mean:",mean1)
