I have a dataframe with columns 'A', 'B', 'C' and I want to create a new dataframe that has columns named 'X', 'Y', 'Z' which will respectively be column 'A' divided by column 'B', 'B' by 'C' and 'A' by 'C'. Also, I want to keep the same index. I have tried the following
new_df = old_df['A'] / old_df['B']
However, I don't know how to add the other columns I want.
old_df['X'] = old_df['A'] / old_df['B']new_df = pandas.DataFrame()and then you cannew_df['X'] = old_df['A']/old_df['B']