Relative Content

Tag Archive for pythonpandasdataframemerge

How do I perform a smear between two dataframes in python/pandas?

I have two dataframes and I need to perform a smear (if that is what it’s generally called). Basically the first one is smaller (5 million rows) and the other is 40 million rows. I want to add the first value of dataframe 1 to the first 8 values of dataset 2, the second from dataframe 1 to the second set of 8 in dataframe 2 and so on.
For example: