-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Spreadsheet Automation #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations!! for making your first PR at Amazing-Python-Scripts, our mentors will review it soon.
@avinashkranjan please add the level tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Amit366 Please add a README.md with instruction on how to run the script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved from my side. @kaustubhgupta please add the tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a generalized script. What happens if I select totally different datasets that do not have "Total Price" and "Purchased Amount" columns? Here is the solution to this:
- Make it a CLI version where the user mentions the dataset 1 column to be compared and the same for dataset 2.
- Take the input for the common column where the merger will happen.
- Now display the plots
@kaustubhgupta sir I have updated it |
Spreadsheet_Automation/script.py
Outdated
item = input("What is the basis of merging? ") | ||
data_total = data_home_1.merge(data_prices, on=item) | ||
|
||
data_total['Total Price'] = data_total['PURCHASED AMOUNT'] * data_total['Price'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not required I think?
Spreadsheet_Automation/script.py
Outdated
data_total['Total Price'] = data_total['PURCHASED AMOUNT'] * data_total['Price'] | ||
|
||
#print(df_total) | ||
material=input("Enter criteria 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name the variables with descriptive meaning. Suggestion:
material=input("Enter criteria 1") | |
criteria_1=input("Enter criteria 1") |
Spreadsheet_Automation/script.py
Outdated
#print(df_total) | ||
material=input("Enter criteria 1") | ||
price=input("Enter criteria 2") | ||
fig = px.pie(data_total[[material, price]], values=price, names=material) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the changes here also
@kaustubhgupta now check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't notice these variables earlier:
Spreadsheet_Automation/script.py
Outdated
import plotly.express as px | ||
|
||
# storing the dataset | ||
book_relative_path = input("Enter first dataset") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two datasets names also need to be changed to something good.
Spreadsheet_Automation/script.py
Outdated
book_prices = input("Enter second dataset") | ||
|
||
# reading the data | ||
data_prices = pd.read_excel(book_prices) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also
Spreadsheet_Automation/script.py
Outdated
|
||
#print(df_prices, df_home_1) | ||
|
||
item = input("What is the basis of merging? ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this item too.
@avinashkranjan updated |
@santushtisharma10 your approval awaited |
@all-contributors please add @Amit366 for code and documentation |
I've put up a pull request to add @Amit366! 🎉 |
Description
The script will compare two spreadsheets and then show a pie chart
Fixes #469