Skip to content

Instantly share code, notes, and snippets.

@lars20070
Created January 9, 2021 19:12
Show Gist options
  • Save lars20070/26efc21a2076f85a189781d93781a237 to your computer and use it in GitHub Desktop.
Save lars20070/26efc21a2076f85a189781d93781a237 to your computer and use it in GitHub Desktop.
attribute trannsfer
df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
df.x = 'Hello'
df2 = df[:-1]
print(df2.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment