Skip to content
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

Sort Excel Sheet Hacktoberfest_Inputt.xls #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ishita-Mehta
Copy link

Addressing Issue #11

Added a folder 'Sort Excel File' with excel_sorter.py

This script reads input excel file, sorts according to Source and Destination column and then outputs a new excel file with sorted rows. This is achieved using pandas library.

@achoudh5
Copy link
Owner

achoudh5 commented Oct 3, 2020

Hi @Ishita-Mehta

Can you import this as a module in zip.py and make zip.py a one stop shop for the user ? Imagine user being not so software friendly, you don't want them to run so many files on cli. Let me know if it makes sense, incase you have any question make a comment and tag me.

Copy link
Owner

@achoudh5 achoudh5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR:-


sorted_dataframe = df.sort_values(['Source', 'Destination'], ascending=[1, 1])
NameError: name 'df' is not defined

…it__.py so that the module can be imported. Imported the module in zip.py and called it in the main() function.
@Ishita-Mehta
Copy link
Author

Hi @achoudh5 Sorry for the delay. Had a busy week at work. I've committed the following changes:

  • Corrected in the error in excel_sorter.py.
  • Added a init.py file to the directory to make it a package.
  • Imported the package in zip.py and called the function from the main() function of zip.py

Please let me know if anything else is to be done. Thanks!

Copy link
Owner

@achoudh5 achoudh5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ishita-Mehta Most of the changes done are good but if I glance at the first column where I am guessing those are the original sheet's row numbers it's a bit wonky. I would request the following changes:-

  • Put a heading in row 1, column 1 . tell the user what these numbers mean?
  • Check the column 1 entries, use more test cases. All the rows with no cource and destination color should be a the bottom (in terms of priority/sorting). So, as per your script i could see that the first row has nothing but abcd text in source column. You should put this rown in bottom just because it didn't come up with a source and dest color.
  • Once you are done with priority/sorting of rows with no source and destination colors, take a look at the mapping of your original row numbers to the newly sorted excel file. The abcd text row which we move to the bottom should still show the mapping to be 1 cz it was row 1 in the original sheet and similarly for others too (ex, Yellow to red row should show line 8 not 6 after sorting too)
  • Can we do it all at one place, zip.py kinda uses the Inputt.xlsx and do the desired changes inplace. Rather than creating a new sorted.xlsx can you do the changes within the original xlsx.

Let me know if you have more questions :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants