ChatGPT As A Data Generator
Among the productive things #chatgpt can do, generating random data to spec is definitely an understated highlight.
Prompt:
You’re now a data generator. I need you to generate the following data in CSV format:
- 100 rows
- 5 columns: “name”, “lastname”, “age”, “height” and “weight”
The impressive part is it *knew* the data type for each column and generated random values accordingly 😲:
=====
name,lastname,age,height,weight
Ethan,Clark,42,180,78.9
Emma,Moore,26,165,55.2
=====
But let’s see if we can push this data type inference further:
Prompt:
You’re now a data generator. I need you to generate the following data in CSV format:
- 25 rows
- 7 columns: “name”, “last_name”, “age”, “height”, “weight”, “sex”, “favorite_color” and “country”
And it did it correctly!
=====
name,last_name,age,height,weight,sex,favorite_color,country
Ethan,Clark,42,180,78.9,Male,Green,United States
Emma,Moore,26,165,55.2,Female,Blue,Canada
Liam,Davis,38,175,74.3,Male,Red,United Kingdom
Avery,Hall,24,170,63.5,Female,Yellow,United States
=====
Let’s try something trickier
Prompt:
You’re now a data generator. I need you to generate the following data in CSV format:
- 10 rows
- 7 columns: “name”, “last_name”, “age”, “height”, “weight”, “sex”, “favorite_fibbonaci_number” and “favorite_german_philosopher”
And it blew my mind 🤯
=====
name,last_name,age,height,weight,sex,favorite_fibbonaci_number,favorite_german_philosopher
Avery,Morris,24,173,68.1,Female,3,Immanuel Kant
Ethan,Foster,35,185,80.9,Male,5,Friedrich Nietzsche
Sophia,Collins,27,167,59.2,Female,8,Georg Wilhelm Friedrich Hegel
Liam,Reed,41,180,83.5,Male,13,Karl Marx
Chloe,Bennett,30,168,62.4,Female,21,Martin Heidegger
=====
This has to be one of the most powerful uses no one talks about. The ability to generate random, type-appropriate data is incredibly valuable.