Skip to content

Instantly share code, notes, and snippets.

@mesmacosta
Last active September 27, 2019 18:01
Show Gist options
  • Select an option

  • Save mesmacosta/d660259cbdd4dd856dcbd26a35cea51b to your computer and use it in GitHub Desktop.

Select an option

Save mesmacosta/d660259cbdd4dd856dcbd26a35cea51b to your computer and use it in GitHub Desktop.
new_metadata = metadata.head(1).copy()
for i in range(100):
row = metadata.head(1)
row['table_name'] = row['table_name'] + str(i)
new_metadata = new_metadata.append(row)
@classmethod
def __get_df_memory_usage(cls, key_value, df):
import io
buf = io.StringIO()
df.info(buf=buf)
info = buf.getvalue().split('\n')[-2]
print(f' key: {key_value} memory: {info}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment