Stack Exchange
Python itertools C# equivalent
My dataset is - 
Col1    Col2    Col3
A       10      x1
B       100     x2
C       1000    x3

The python code I have right now is - 
data = pd.read_csv('input.csv')

# print (data)

arr = list(itertools.chain.from_iterable(
    [[j for i in el for j in i] for el in itertools.combinations(data.values.tolist(),i)]
    for i in range(1, len(data)+1)
))

# print (arr)

new_data = pd.DataFrame(arr)

The output that it produces is this - 
Col1    Col2    Col3    Col4    Col5    Col6    Col7    Col8    Col9
A       10      x1      Empty   Empty   Empty   Empty   Empty   Empty
B       100     x2      Empty   Empty   Empty   Empty   Empty   Empty
C       1000    x3      Empty   Empty   Empty   Empty   Empty   Empty
A       10      x1      B       100     x2      Empty   Empty   Empty
B       100     x2      C       1000    x3      Empty   Empty   Empty
A       10      x1      B       100     x2      C       1000    x3

What would the equivalent C# code be? Is there a library in C#, which does this? Equivalent to what itertools does?

Not exactly but mostly, you may start with System.Linq.Enumerable

Actually I don't know Python but from what I got from your code, maybe foreach is what you are looking for.
