Created
August 28, 2021 17:45
-
-
Save marcosan93/bf3206c75197ff94ade3a0ee170bebbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def makeBio(subscriber): | |
| """ | |
| Making a short or long bio depending their subscription status. | |
| """ | |
| if subscriber==True: | |
| # Randomizing bio length but skewed towards longer bios | |
| bio_len = random.choices([10,20], weights=(10,90), k=1)[0] | |
| elif subscriber==False: | |
| # Randomizing bio length but skewed towards shorter bios | |
| bio_len = random.choices([1,3], weights=(10,90), k=1)[0] | |
| return faker.sentence(bio_len) | |
| df['bio'] = [makeBio(i) for i in df['subscriber']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment