Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- df = pd.DataFrame([['A', 1], ['B', 2], ['C', 3]] , columns = ['col1', 'col2'])
- .assign(col3 = 2 * col2)
- df <- data.frame(col1 = LETTERS[1:3], col2 = 1:3) %>% mutate(col3 = 2 * col2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement