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 numerical data
From the course: Advanced Python: Top Tools for Data Science and Engineering
Generating numerical data
- [Instructor] In this example, we're going to take a closer look at some of Faker's capabilities for generating numeric data. Let's open up numbers, Faker. And here in my starting point code, I have imported Faker and created a class instance. So let's try out some basic number generation features. So Faker can generate random numbers. So let's print out some fake, random information. So I'll do a random number and then let's do a random integer. Faker can also generate native Python types. So let's print out a fake py decimal. Let's do a fake float. And we can even do booleans. All right, so let's go ahead and try that out. So you can see the results here. So the first two numbers are the random number and random integer. The next big number is a random decimal. And then we have our float and the boolean. And if I run this a few times, you can see that the data changes each time. You can also see that decimals can get pretty big. Let's do it again, so you can see the data is…