Reputation: 2342
I have DataFrame like below:
df = pd.DataFrame({"code" : [1,1,2,2,3], "value" : [10, 11, 11, 11, 30]})
And I need to create loop which in result give me all combinations of code x value so:
1 10
1 11
2 11
3 30
How can I do that ? It can be also as a def
Upvotes: 0
Views: 86
Reputation: 1
If I did understand your question correctly :
for index,row in df.iterrows():
print("{} {}".format(row["code"],row["value"]))
Please feel free to explain your question further if that is not what you needed. You may provide more examples as well
Upvotes: 0