for i in range(20):
fake_dataset.append(fake.name())
fake_dataset.append(fake.company())
fake_dataset.append(fake.date_between(start_date="-10y", end_date="now"))
fake_dataset.append(fake.email())
fake_dataset.append(fake.job())
I generate this as rows but I want to create a for loop that adds data to the respective column, names to name column etc. How can I do this?
I tried this but it didnt work:
names = []
for i in range(20):
names.append(fake.name())
fake_dataset["Name"] = names
Error Message: TypeError: list indices must be integers or slices, not str