Python Forum

Full Version: Merging two Data Frame on a special case
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I have two data Frame one with date and one with product

df_A = date1, date2, date3............
df B = P1, P2, P3

All I need to create a data frame where there is product (P1, P2.....) for all the date in df A

Like the following
dfC = {date1: P1, date 2:P1, date3:P1......................date1: P3, date2:P3, date3:P3}

I know that I can use a for loop to do the same, but my data set is humongous and it takes almost 10 hrs to complete the loop. Is there an alternative faster way where I can create the same.

Thanks,