I friends. I would like to ask how to orgnize subtruction of columns. so the dataframe is as below:
when I subtruct columns from each other I use the following code:
when I subtruct columns from each other I use the following code:
df['new'] = df.column_1 - df.column_2but I need to subtract b from a, c from b and so on and combine(plus) the results in one column
df = pd.DataFrame(np.random.randint(low=0, high=10, size=(5, 5)),columns=['a', 'b', 'c', 'd', 'e'])thanks in advance
a b c d e 6 5 6 8 3 4 9 2 4 2 1 7 9 4 3 3 1 5 2 3 2 8 3 5 7