Created
March 21, 2019 09:37
-
-
Save viniroger/6b3f7273db52faf83012c8b2c2f819f5 to your computer and use it in GitHub Desktop.
Fill a column from a pandas dataframe with random values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
random.seed(42) | |
df['column_name'] = df['column_name'].apply(lambda v: random.random() * 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment