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 - SQL Tutorial
From the course: Fundamentals of Data Transformation for Data Engineering
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
-
-
-
-
-
(Locked)
DataFrame basics6m 14s
-
(Locked)
Wrangling unstructured data13m 41s
-
(Locked)
Select and filter10m 49s
-
(Locked)
Order and aggregate9m 47s
-
(Locked)
Advanced filters3m 53s
-
(Locked)
Data generation6m 37s
-
(Locked)
Windows5m 26s
-
(Locked)
Apply6m 14s
-
(Locked)
pandas challenge2m
-
(Locked)
pandas solution12m 45s
-
(Locked)
-