I have a function which creates data
from faker import Faker
import pandas as pd
import random
def create_rows_faker(num=1, name_col = True, address_col = True, email_col = False):
output = []
for x in range(num):
out = {}
if name_col:
out["name"] = fake.name()
if address_col:
out["address"] = fake.address()
if email_col:
out["email"] = fake.email()
output.append(out)
return output
but I want to remove the multiple if statements inside the for loop. What is the best method to improve this?