From the course: Fundamentals of Data Transformation for Data Engineering

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Data generation

Data generation

- [Instructor] So, now we're going to talk about how you can generate data using pandas, using Python, very similar to how we did in SQL. Maybe a little bit easier, but the complex thing usually comes from working with indices in pandas. But we're going to break that down, especially when generating continuous date ranges like we did with the alerts data frame. You might know where this is headed if you were following along earlier, but we're going to start off by importing pandas and we're going to use PD.date range because that's the easiest way to generate date ranges in Python. And that's just going to create a pandas series using the parameters we specified. So very similar syntax start and then the frequency. So you can imagine this being day, week, month, et cetera. And from that we can create a data frame with a time index by actually specifying PD.data frame just like we did in that intro lesson. And then supplying the data and supplying the index as our dates. So we're…

Contents