You can use any iterable to make these combinations.

If you are new to Python, this answer tries to clarify some options.

**Given**

A *reducing* function `mul`

and an iterable of data:

```
def mul(a, b): # 1
"""Return a rounded multiple."""
return round(a * b, 2)
data = [0.1, 0.2, 0.3, 0.5] # 2
```

**Code**

Prepare an iterable - a linear container that can be looped over. Examples:

*Option 1 - An iterator*

```
iterable = it.combinations(data, 2)
```

*Option 2 - pandas DataFrame*

```
df = pd.DataFrame(data, columns=["weights"])
iterable = it.combinations(df["weights"], 2)
```

**Demo**

```
[mul(x, y) for x, y in iterable] # 3
# [0.02, 0.03, 0.05, 0.06, 0.1, 0.15]
```

**Details**

- This function contains the operation you want to apply.
- A simple iterable (e.g.
`list`

) of data. Note, it need not be nested.
- Use any iterable to reduce the pairs of combinations

*Option 3 - pandas Operations*

Alternatively, once you have data in pandas, you can stick with it:

```
combs = list(it.combinations(data, 2))
df = pd.DataFrame(combs, columns=["a", "b"])
df
# a b
# 0 0.1 0.2
# 1 0.1 0.3
# 2 0.1 0.5
# 3 0.2 0.3
# 4 0.2 0.5
# 5 0.3 0.5
df.prod(axis=1).round(2).tolist()
# [0.02, 0.03, 0.05, 0.06, 0.1, 0.15]
```

I'd recommend choosing either pure Python or `pandas`

(options 1 or 3).