From the course: Advanced Python: Top Tools for Data Science and Engineering
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Generating basic data
From the course: Advanced Python: Top Tools for Data Science and Engineering
Generating basic data
- [Instructor] Let's take a look at how to use the basics of Faker, and I'm going to open up the basic Faker file in the start section here. First, we need to import the Faker library in order to use it. And you can see I've already done that. And then next we need to create an instance of the Faker library class. So I've already done that, and now we can start generating fake data. So let's create some basic fake information. So I'll print out fake random number. Let's make a fake date, and then let's make some fake text. Alright, let's try running that. Okay, and you can see here in the output, I have an integer, a date, and a nonsensical sentence with random words in it. So the Faker library used its internal generation engine to randomly create the types of fake data that I requested. And if I run it again, you can see that the data changes each time. So I'll do it one more time, and you can see that the data is changing each time. But Faker can do more than just generate random…