Last active
December 10, 2021 11:25
-
-
Save eddjberry/9b6f7c697a7ec2a442c2031b056b556c to your computer and use it in GitHub Desktop.
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 pandas as pd | |
from faker import Faker | |
# set the seed | |
Faker.seed(10) | |
# set the locale to GB | |
fake = Faker("en_GB") | |
# how many customers to fake | |
N = 1000 | |
# get first names, last names and postcodes | |
fname = [fake.first_name() for i in range(N)] | |
lname = [fake.last_name() for i in range(N)] | |
pcode = [fake.postcode() for i in range(N)] | |
# create a dataframe | |
df_fake = pd.DataFrame({ | |
"fname": fname, | |
"lname": lname, | |
"pcode": pcode}) | |
# save to a csv | |
df_fake.to_csv("data/fake_customers.csv", index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment