Skip to content

Instantly share code, notes, and snippets.

@kennir
Last active July 5, 2016 05:44
Show Gist options
  • Save kennir/35795c4a3de82f3fe0065d94f1092efc to your computer and use it in GitHub Desktop.
Save kennir/35795c4a3de82f3fe0065d94f1092efc to your computer and use it in GitHub Desktop.
Adds a new column where each entry is the list of two other columns
df= pd.DataFrame(np.random.randn(10,4))
df[4]= [[df[2][x],df[3][x]] for x in range(df.shape[0])]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment