Skip to content

Conversation

@steph7806
Copy link

Feel free to edit!

So what i'm trying to do is download a csv file, compare it to a previous download, and if there is a change the most recent download changes to the "master" so that a later download can be compared to a new one. Sn the side i'm editing an alert system so that it tells you there has been a change along with the exact changes.

@arjunsavel
Copy link

Hi @steph7806 — is this the code with which you're having difficulty comparing tables?

@steph7806
Copy link
Author

I managed to get most of my debuging done but I'm having problems using pandas to compare all the columns instead of one.

@arjunsavel
Copy link

Glad you were able to make progress! One way to compare all columns would be to use something like np.all(frame1 == frame2). The condition (frame1 == frame2) creates a new DataFrame, with each cell being True or False depending on whether the two frames have identical values in those cells. The np.all function then takes that new DataFrame and checks whether all its cells are True.

Something to consider, though, is that if ExoFOP decides to add a new column to their tables, this might not work well — so you should have something that could catch the addition for a new column, as well. Please let me know if this doesn't make sense / if you have any questions!

steph7806 added 3 commits June 9, 2020 15:19
This is close to what I want the final product to be (with sending the email) but there's still more I want to (like sending the file with the changes).
I'm still fiddling with the format of the result file, but otherwise this is it! The idea of the result file is that it holds the differences between masterlist and comparison. I'm working out the comparison and trying to see if there is a more efficient way to get the differences. Once I get friendlier with TRAVIS, introduced by Arjun to run the code every day, it should be set!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants