From the course: Python Data Analysis
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Simulating data - Python Tutorial
From the course: Python Data Analysis
Simulating data
- [Instructor] Sometimes you need to develop a data analysis application before you have access to the data. In that case, a good approach is creating fake data with the right structure and realistic content. Then you can use that to populate your tables and test your algorithms. However, making these records by hand can be very time-consuming. Of course, the Python ecosystem can help with that. The Faker package is a popular library to generate random, realistic-looking fake data, such as names, addresses, dates, and more. Let's have a look at what it can do. Note, there's a lot of detail in this code, so it may help you to occasionally stop the video and parse the code to make sure we understand what's happening. We start by creating an instance of the Faker class. Then we can call its methods to make up a person, a name, address, date of birth, city, and state. To make this a bit more interesting, we're going to create a database of imaginary musical performers of their songs and…