Categories
Blog # 55 – How to create a csv file with Random data using python
How to create random csv using through Python

I was searching for a particular file which contains specific random data to be used in one of the online training for my data science course. The instructor forgot to provide the data file but I only had the label of data with me.

After searching on net for that particular file, idea came in my mind to use Microsoft copilot AI to generate a csv file with the labels I have using Python.

Therefore I used the following prompt on CoPilot to generate me the python code to run.

"please create a python code which can generate a csv file which contains following labelled data with 100 rows of random details. first name, last name, place of birth, current address, post code, kids, email address."

Make sure you have the faker library installed (pip install faker) before running this code. It will create a CSV file named “random_data.csv” in the same directory as your Python script. Feel free to adjust the data fields or customize the code as needed! 

Leave a Reply

Your email address will not be published. Required fields are marked *