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

HW3 - Buckler #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bucklerd
Copy link

@bucklerd bucklerd commented Feb 8, 2019

Recommendations to streamline the 'cleaning' function I used in Lab1 part 3 (~ line 70). It works well, but seems a little cluncky. Suggestions welcome.

@rossbernet
Copy link
Member

Regarding lab1/part3 - yes. There are some really easy ways to sort of do this, and some much more involved ways to do this really well.

This is an extremely good solution:


console.log('Which games are owned by both Ross and Nathan', query7);

/* =====================
Which games are exclusive to collections? In other words, only owned by either Ross or Nathan.
===================== */

var query8;
var query8 = _.difference(rossGameList, nathanGameList);
Copy link
Member

Choose a reason for hiding this comment

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

difference is insufficient here to capture the games that Nathan has that Ross does not have.

} else {n=1};
temp.push(obj[n], obj[n+1]);
if(typeof obj[n+2] === 'string') {
if(!obj[n+2].includes('stations')) {
Copy link
Member

Choose a reason for hiding this comment

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

The solution I pointed you earlier ---

basically does a loop in a loop to check every single entry. And checks to see if they are numbers doing something similar to what you've done. You have a pretty good solution here - if you really want additional feedback we can try to call @moradology (this is in reference to @bucklerd s comment on the pull request if there is a better way to do this bike data cleaning.

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