# How to perform element wise operation on two sets of columns in pandas

I have the dataframe:

```
c1 | c2 | c3 | c4
5 | 4 | 9 | 3
```

How could I perform element wise division (or some other operation) between c1/c2 and c3/c4

So that the outcome is:

```
.5555 | 1.33333
```

I've tried:

```
df[['c1', 'c2']].div(df[['c3', 'c4']], axis='index'))
```

But that just resulted in NaNs.

Nick Brady
answered question

### 1 Answer

I'm not positive I'm understanding your question correctly , but you can literally just divide the series.

```
df['c1/c2'] = df['c1'] / df['c2']
```

See this answer: How to divide two column in a dataframe

Nick Brady
posted this

## Have an answer?

JD

What is that outcome supposed to be? A new dataframe? Without columns?