Skip to content

Instantly share code, notes, and snippets.

@vincentclaes
Created August 31, 2022 08:25
Show Gist options
  • Save vincentclaes/a9fab82074be64b925fb3409776f05f9 to your computer and use it in GitHub Desktop.
Save vincentclaes/a9fab82074be64b925fb3409776f05f9 to your computer and use it in GitHub Desktop.
Repeat a pandas dataframe n times
n = 1000
df = pd.DataFrame(
np.repeat(df.to_numpy(), n, axis=0), columns=df.columns
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment