Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Last active January 17, 2022 08:35
Show Gist options
  • Select an option

  • Save RaMSFT/a0623ab3bcba5109ba9191b1bb1442a3 to your computer and use it in GitHub Desktop.

Select an option

Save RaMSFT/a0623ab3bcba5109ba9191b1bb1442a3 to your computer and use it in GitHub Desktop.
from faker import Faker
import pandas as pd
def customer_data(out_file, country, number_of_records):
out_file_name = ''
fake = Faker(country)
data_list = []
columns_list = ['id', 'FirstName', 'LastName','Gender', 'DateOfBirth','PhoneNumber','Occupation','Company','PersonalEmail','OfficialEmail','BSNNumber','IBAN','HouseNumber','StreetName','PostCode','City','Country']
for val in range(number_of_records):
data_list.append([fake.unique.random_int(), fake.first_name(), fake.last_name(), fake.profile()['sex'], fake.date_of_birth(),fake.phone_number(), fake.job(), fake.company(), fake.email(), fake.company_email(), fake.ssn(), fake.iban(), fake.building_number(),fake.street_name(), fake.postcode(), fake.city(), 'Netherlands'])
df = pd.DataFrame(data_list,columns=columns_list)
df.to_csv(out_file, mode='w', index = False)
customer_data(out_file= 'customer_data.csv', country='nl_NL', number_of_records=1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment