0

i want to add a row with ~20K symbols to each existing row in dataframe

You can find an example on a picture below. Basically I just need to add the row from Table 2 to every row of Table 1 to get Table 3.

enter image description here

To do this, I use concatenated_rows = pd.concat([pd.concat([df.iloc[[0]], row], axis=1) for _, row in df2.iterrows()], ignore_index=True)

which ends in: killed

is there any way to create this dataset without getting it killed due to memory problem?

aeti
  • 5
  • 1
  • You'll need to tell us how much memory your dataframes take up. Also post your [data in text format](https://meta.stackoverflow.com/q/285551/), not as screenshots, ideally as a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) that clearly shows your desired output. Also see [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391). – AlexK Mar 13 '23 at 03:06

0 Answers0