课程: Hands-On Data Science using SQL, Tableau, Python, and Spark

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Aggregating data with pandas

Aggregating data with pandas

- Now that we've looked at our data set here, our monthly sales data set, what we're going to do now is perform some aggregations, do some real analytics work inside of Jupyter. Back here in Jupyter on the folder that has all my examples, I'm going to open up the second one, the aggregating data with pandas. It's going to bring that up into a new workbook for me. It's going to go ahead and get the kernel running. We'll start going here. We will run the first one, import pandas. Good. We're going to read in the CSV just like we did before. And then here what we're going to pull out is actually the month of order date, and we're just going to pull out four characters there, which is going to give us the year. So I'll go ahead and run this and you can see what we got here. So instead of having the full order date, we have the year, this is going to be good because when we want to perform analytics on it, we can actually use this as another level of aggregation. Now if you recall, inside…

内容