Hello,
I am looking for Python Pandas code to perform the following:
The input data is two tables, Orders and Categories (provided as CSV files)
Main work is on the Orders table. The table consists of 6 columns:
Order_Date | Location | Category | Sub-Category | Prod_Name | Sales |
10/18/2016 | London | Office | Appliances | aaa | 400 |
You should use Pandas in order to create a Pivot table summed by MONTH:
Group by Category (sum Sales)
Group by Location (sum Sales)
Filter by Month (sum of all the Sales in that month)
The second step is to sort the Pivot Table by the Categories table which consists of only 2 columns:
Category_Name | Category_ID
Office | 80
Furniture | 85
Technology | 90
The result table should look like:
========================
Category_ID | Category | Berlin | London | New-York | Grand Total
...
Totals per column
========================
Notes:
1. The month will be provided as a variable to the code, in the example; report_month = '2017-10'
2. See linked Google Sheets that include a Pivot Table simulating the required outcome
3. Code can be provided as text or as a Jupyter Notebook (whichever is more comfortable to you)
4. The result table should be a DataFrame, (so, for example I can activate DataFrame.to_html on it)
5. The following code is a suggestion for starting the coding:
import pandas as pd
df = pd.read_csv('[login to view URL]',parse_dates=['Order_Date'])
pd.options.display.float_format = '{:,.0f}'.format
df.pivot_table(index=[[login to view URL](freq='M', key='Order_Date'),],columns=['Category','Location'],values="Sales", aggfunc="sum")
[login to view URL]
Many thanks,
Nadir
Hi there.....
Warm Greetings
We came along with your request for Python Pandas Pivot Table Code and we reviewed your project description. We'd like to help you with confidence and satisfying results...
We have professionals working here with 100% results and more creative and renovative ideas for our clients !
We have worked on several similar projects before!
We are offering our services for more than 5 years in the field of Excel, Python
We have worked on 300+ Projects. Please check the profile reviews
Feel free to message us to discuss briefly about your project !
Hi there, I will be looking forward to hear from you to discus the work-ability of the project. I can complete this for you at a pocket friendly budget.
Hi there! I'm a data entry expert, with over 1 years experience dealing with Microsoft office, excel, web upload, data collect etc with typing speed(40 wpm). I can help complete your project. I've previously worked on the exact same project for another employer >>> {www.freelancer.com/u/ANimesh996}<<<.
When do you need this finished by? I understand how annoying it is, and can get this fixed for you quickly!
Please see the sample I fixed and I look forward to working on this project with you.I will also respond to your messages as quick as I could. :) Message me.
I've worked with panda library. And there are operations which let me to develop the requirements (group by and calculate total).
Relevant Skills and Experience
I've worked with python with different data scientist libraries. The idea is use this library to solve the requirements with the built in functions.