Answers for "pandas cartesian product"

0

pandas cartesian product

a = [1, 2, 3]
b = ["a", "b", "c"]

index = pd.MultiIndex.from_product([a, b], names = ["a", "b"])

pd.DataFrame(index = index).reset_index()
Posted by: Guest on October-10-2020

Python Answers by Framework

Browse Popular Code Answers by Language