I couldn't find an answer in my specific data frame case. Would like to use a Cartesian product (Cross Join) on a large dataset in Python. I found many related posts like: Performant cartesian product (CROSS JOIN) with pandas but non of these can be easily applied by me because I have indexes and I can't easily slice my data set to single columns and then merge.
My data: where years(2021-2022) and days(1D,2D,3D) are indexes.
My goal: is a cartesian product of these with creating "new" indexes which I can't grab easily at the moment. The new indexes are: Years, Days and Names.
Solutions like: data3 = d1.merge(d2, how="cross")
didn't work as the year index was removed and too many columns were created without assigning days as a column.