Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add the number to email address in faker library in python?

import pandas as pd
import numpy as np
import os
import random
from faker import Faker

def faker_categorical(num=1, seed=None):
    np.random.seed(seed)
    fake.seed_instance(seed)
    output = []
    for x in range(num):
      gender = np.random.choice(["M", "F"], p=[0.5, 0.5])
      output.append(
        {
            "First name": fake.first_name_male() if gender=="M" else  
                                                 fake.first_name_female(),
            "Last name": fake.last_name(),
            "E-mail": fake.ascii_email(),  
        })
    return output
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #number #email #address #faker #library
ADD COMMENT
Topic
Name
5+1 =