Python Tutorial 6.0
But before entering into the dangerous combat arena with the furious statistical techniques, better learn all the basic moves !!!
Please download the .csv file that you can use to practice the codes.
import pandas as p
Aggregation=p.read_csv('C:\\data.csv')
Aggregation
sample output :
Only showing top 20 observations
Let's play our favorite game "Question and answer" to learn the concepts.
Q1. How many rows are there in the dataset?
Ans: Aggregation['Product'].count() # we can take any column instead of product, the result would remain same
Output:
Q2. How much is the total sales?
Ans: Aggregation['Sales'].sum()
Output:
Q3. What is the total sale of 'APAC' Region?
Ans. Aggregation['Sales'][(Aggregation.Region=='APAC')].sum()
Output:
Q4. What is the total sale of Product 'A' in 'APAC' Region?
Ans. Aggregation['Sales'][(Aggregation.Product=='A')&(Aggregation.Region=='APAC') ].sum()
Output:
Apart from count and sum, there are many functions which you can use to get basic statistic about the data. e. g.
mean, median, min, max, mode and std etc.
Q5. How many unique products are there?
Ans: Aggregation['Product'].nunique()
Let's learn how to aggregate the data group wise
Q6. How to get a list of all distinct products?
Ans. Aggregation.groupby(['Product']).groups.keys()
Output:
Q7. Get sales by products
Ans. Aggregation.groupby('Product')['Sales'].sum()
Output:
Q8. Get sales by Products of 'APAC' Region only
Ans. Aggregation[Aggregation['Region']=='APAC'].groupby('Product')['Sales'].sum()
Output:
Let me just add one more dimension to it
Let's now aggregate the data using multiple variables with multiple measures.
Q9. Create a table of total sales by Product and Region
Ans. Aggregation.groupby(['Product','Region'])['Sales'].sum()
Output:
Ans. Aggregation.groupby(['Product','Region']).agg({'Sales':{'total_sales':'sum','Frequency':'count'}})
Whatever be the operation and calculation we have done in above examples either would create Panda Series or Panda Dataframe.
If we go theoretically then one column's output is called series and multiple column's output is called dataframe.
We can change it by a small change in syntax. Lets see how..
Q9. from above examples
a=Aggregation.groupby(['Product','Region'])['Sales'].sum() # produce data series
type(a)
Output:

Add only additional bracket to aggregated variable
type(a)
Output:
One more concept I would like to tell you is indexing
If you see the output of Q9 then you must have noticed that in Product column there are blank entries populated if a product is same. It is called indexing; an output is indexed by Product and Region.
Since we may want to utilize this dataframe for further data processing, so it is good if we fill these blank entries.
To avoid this index(blank entries), pass “as_index=False” to the groupby operation.
a=Aggregation.groupby(['Region','Product'],as_index=False)[['Sales']].sum()
a
Output:
and that's it for now! We have learned aggregation ...
Enjoy reading our other articles and stay tuned with us.
Kindly do provide your feedback in the 'Comments' Section and share as much as possible.
Very useful information, Keep posting more blog likes this, Thank you.
ReplyDeleteAviation Courses in Chennai
cabin crew training institute in Chennai
airlines training Chennai
Ground staff training in Chennai
Aviation Academy in Chennai
air hostess training in Chennai
airport management courses in Chennai
ground staff training in Chennai
Great Article
DeleteArtificial Intelligence Projects for CSE
Project Centers in Chennai
JavaScript Training in Chennai
JavaScript Training in Chennai
Housekeeping services in mumbai | corporate housekeeping services in mumbai | professional housekeeping services in Mumbai | housekeeping staff provider in mumbai | housekeeping services in mumbai for offices |
ReplyDeletesecurity guard services in Mumbai | security guard in mumbai | security guards agency in Mumbai | security guards company in mumbai | glass facade cleaning services in mumbai | facade cleaning services mumbai |
To be a decent information researcher, it is critical to be curious, take a gander at information and determine bits of knowledge, spot inclines, etc. Basically, all exertion is aimed at realizing hierarchical change. data science course in pune
ReplyDeleteI feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
ReplyDeletebusiness analytics course in delhi
Attend The Machine Learning course in Bangalore From ExcelR. Practical Machine Learning course in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning course in Bangalore.
ReplyDeleteMachine Learning course in Bangalore
Thank you so much for helping me out to find the Data analytics course in MumbaiOrganisations and introducing reputed stalwarts in the industry dealing with data analyzing & assorting it in a structured and precise manner. Keep up the good work. Looking forward to view more from you.
ReplyDeleteNice Post...I have learn some new information.thanks for sharing.
ReplyDeleteExcelR data analytics course in Pune | business analytics course | data scientist course in Pune
Such a very useful article. I have learn some new information.thanks for sharing.
ReplyDeletedata scientist course in mumbai
ReplyDeleteExcelr is providing emerging & trending technology training, such as for data science, Machine learning, Artificial Intelligence, AWS, Tableau, Digital Marketing. Excelr is standing as a leader in providing quality training on top demanding technologies in 2019. Excelr`s versatile training is making a huge difference all across the globe. Enable ?business analytics? skills in you, and the trainers who were delivering training on these are industry stalwarts. Get certification on "
data science course fees in hyderabad"and get trained with Excelr.
I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
ReplyDeleteData science course in mumbai
Nice Blog...Very interesting to read this article. I have learn some new information.thanks for sharing.
ReplyDeleteExcelR Mumbai
Very nice blog here and thanks for post it.. Keep blogging...
ReplyDeleteExcelR data science training
Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share.
ReplyDeletedata analytics course hyderabad
I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
ReplyDeletedata science course in mumbai
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplyDeletedata science course in mumbai
Such a very useful article. I have learn some new information.thanks for sharing.
ReplyDeletedata analytics courses
ReplyDeleteThere is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job!.... data science course Bangalore
This post is very simple to read and appreciate without leaving any details out. Great work! data science courses
ReplyDeleteI am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
ReplyDeleteExcelR Data Analytics Course
Data Science Interview Questions
your article on data science is very interesting thank you so much.
ReplyDeleteData Science Training in Hyderabad
Data Science course in Hyderabad
Data Science coaching in Hyderabad
Data Science Training institute in Hyderabad
Data Science institute in Hyderabad
Nice Article...Very interesting to read this article. I have learned some new information.thanks for sharing.
ReplyDeleteData Science Training in Hyderabad
Data Science course in Hyderabad
Data Science coaching in Hyderabad
Data Science Training institute in Hyderabad
Data Science institute in Hyderabad
Grow your career with Python in machine learning. High technologies solutions is the best Python training institute in Delhi and Noida with 100% placement help. 5+ years experienced trainers.Join now!! Call at +919311002620.
ReplyDeletePython with machine learning training in delhi
Python with machine learning training in Noida
keep up the good work. this is an Ossam post. This is to helpful, i have read here all post. i am impressed. thank you. this is our data analytics course mumbai
ReplyDeletedata analytics course mumbai | https://www.excelr.com/data-analytics-certification-training-course-in-mumbai
This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,
ReplyDeleteThis is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteDental care for kids
This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,
ReplyDeleteImpressive! I finally found a great post here. Nice article on data science . It's really a nice experience to read your post. Thanks for sharing your innovative ideas to our vision.
ReplyDeleteData Science Course
Data Science Course in Marathahalli
Data Science Course Training in Bangalore
The information provided on the site is informative. Looking forward for more such blogs. Thanks for sharing .
ReplyDeleteArtificial Inteligence course in Delhi
AI Course in Delhi
Cool stuff you have and you keep overhaul every one of us
ReplyDeletedata analytics courses
business analytics course
data science interview questions
data science course in mumbai
ReplyDeleteThe blog is very informative.Keep posting like this.
Aviation academy in chennai
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyDeleteData science Interview Questions
I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
ReplyDeleteExcelR data analytics courses
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care
ReplyDeletehttp://chennaitraining.in/qliksense-training-in-chennai/
http://chennaitraining.in/pentaho-training-in-chennai/
http://chennaitraining.in/machine-learning-training-in-chennai/
http://chennaitraining.in/artificial-intelligence-training-in-chennai/
http://chennaitraining.in/snaplogic-training-in-chennai/
http://chennaitraining.in/snowflake-training-in-chennai/
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
ReplyDeleteData science Interview Questions
Data Science Course
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
ReplyDeletedata analytics course in Bangalore
Attend The Bangalore Digital Marketing Course From ExcelR. Practical Bangalore Digital Marketing Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Bangalore Digital Marketing Course.
ReplyDeleteBangalore Digital Marketing Course
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeleteSimple Linear Regression
This was really one of my favorite website. Please keep on posting. ExcelR Data Science Course In Pune
ReplyDeleteAttend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses.
ReplyDeleteData Science Courses
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science certification
ReplyDeleteSuperb Information, I really appreciated with it, This is fine to read and valuable pro potential, I really bookmark it, pro broaden read. Appreciation pro sharing. I like it. ExcelR Data Scientist Course In Pune
ReplyDeleteSuch a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
ReplyDeleteThis post is really helpful for us. I certainly love this website, keep on it.
Data Science Course in Hyderabad
Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyDeleteData Science In Banglore With Placements
Data Science Course In Bangalore
Data Science Training In Bangalore
Best Data Science Courses In Bangalore
Data Science Institute In Bangalore
Thank you..
The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. machine learning projects for final year In case you will succeed, you have to begin building machine learning projects in the near future.
ReplyDeleteProjects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.
Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.
Avail Best Data Science Course in Bangalore and Kick Start Your Career as a Successful Data Scientist in Bangalore within 4 months. Data Science Course in Bangalore | Data Scientist Training in Bangalore with Placements. Learn the advanced data science course concepts and get your skills upgraded from the pioneers in Data Science.
ReplyDeleteOnline Data Science Course in Bangalore
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple linear regression
data science interview questions
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing
ReplyDeletebest data analyst courses in mumbai
Thanks for sharing great information. I like your blog and highly recommend. We also offer best data science training in Hyderabaddata scientist courses
ReplyDeleteAttend The Data Analyst Course From ExcelR. Practical Data Analyst Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analyst Course.
ReplyDeleteData Analyst Course
This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data sciecne course in hyderabad
ReplyDeleteAmazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteSimple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Amazing post found to be very impressive while going through this post. Thanks for sharing and keep posting such an informative content. data science courses
ReplyDelete
ReplyDeleteYou might comment on the order system of the blog. You should chat it's splendid. Your blog audit would swell up your visitors. I was very pleased to find this site.I wanted to thank you for this great read!!
Data Analyst Course
Impressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog. data science training in Hyderabad
ReplyDelete
ReplyDeleteI just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. ExcelR Data Science Course In Pune Any way I’ll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.
Found your post interesting to read. I cant wait to see your post soon. Good Luck for the upcoming update. This article is really very interesting and effective, data science courses
ReplyDeleteAttend The Data Analyst Course From ExcelR. Practical Data Analyst Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analyst Course.
ReplyDeleteData Analyst Course
Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteSimple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.data science training in Hyderabad
ReplyDeleteAmazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Logistic Regression explained
Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad
ReplyDeletevery well explained .I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteSimple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained
Attend The Data Analytics Courses From ExcelR. Practical Data Analytics Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analytics Courses.
ReplyDeleteData Analytics Courses
There is no dearth of Data Science course syllabus or resources. Learn the advanced data science course concepts and get your skills upgraded from the pioneers in Data Science.
ReplyDeletedata science course syllabus
Leave the city behind & drive with us for a Thrilling drive over the Desert Dunes & Experience a lavish dinner with amazing shows in our Desert Camp.
ReplyDeletedesert safari dubai
very well explained .I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteSimple Linear Regression
Correlation vs covariance
data science interview questions
KNN Algorithm
Logistic Regression explained
Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science course in Hyderabad
ReplyDeleteIt is also said that data science is the base of artificial learning and everyone knows how artificial intelligence has made a dramatic entrance into our lives. data science course syllabus
ReplyDeleteThank you for sharing such a useful post with us, it will useful for everybody, so keep it up that is decent work.data science training in Hyderabad
ReplyDeleteAttend The Course in Data Analytics From ExcelR. Practical Course in Data Analytics Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Course in Data Analytics.
ReplyDeleteCourse in Data Analytics
Wonderful article. Very interesting to read this article. I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. Keep it up.
ReplyDeleteData Science Training in Hyderabad
Data Science Course in Hyderabad
I've read this post and if I could I desire to suggest you some interesting things or suggestions. Perhaps you could write next articles referring to this article. I want to read more things about it!
ReplyDeletedata science training
A good example of such a philosophy is known as Tesler's law, which defines artificial intelligence as "that which machines cannot do" which implies that any possibility of an artificial intelligence is impossible and that concepts and attributes such as intuition are abilities that are unique to human. data science course in india
ReplyDeletehttps://www.btreesystems.com
ReplyDeleteaws training in chennai
Python training in Chennai
data science training in chennai
hadoop training in chennai
machine learning training chennai
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.data scientist course in pune with placement
ReplyDeleteGreat post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.data scientist course in pune with placement
ReplyDeleteNice Blog!!! Waiting for your new post... thanks for sharing with us.
ReplyDeletefuture of digital marketing
big data analytics
best technology to learn for future
graphic design examples
rpa interview questions and answers pdf
angularjs interview questions for experienced
Thanks for sharing such a valuable information with us. Otherwise any one who want to learn python core to advance contact us on 9311002620 or visit :-https://www.htsindia.com/Courses/python/python-training-institute-in-south-delhi
ReplyDeletevery informative blog
ReplyDeletedata science training in Pune
Amazing Info. Keep Going!
ReplyDeleteHi, Thanks for sharing. Very informative post, that I have ever read, the strategy given is really very helpful....Here I’m giving best ONLINE PLACEMENT TRAINING details, once go through it.
ReplyDeletePLACEMENT TRAINING IN HYDERABAD