Going fast! #DataquestChallenge Premium Annual Offer:
500 get 50% & the next 1000 get 40% off.
GET OFFER CODE

Looking for study partner for Data Science

Hello All,

I am Ankush from India and I am from non IT background. I was doing the course just fine till Jupyter notebook came in and the feedback that I used to get after writing the code went off. I literally feel lack of moving ahead as I couldn’t comprehend the logic behind the code written at some parts and why we have used it.

If anyone can help me understand the logic of the program , I am stuck with the project 1 of the python fundamentals since past 1 month and losing my hopes from dataquest.

Thanks and Regards,
Ankush Malik

1 Like

Hi @AnkushMalik I would be happy to help you out! Can you be a little more specific about where you are having difficulty? Can you provide some code examples that we can work on together?

A lot of us get discouraged at times and that’s what is so great about this community; you are not alone!

2 Likes

Hi Ankush!

I am sorry that you are going through a drop in motivation and have been stuck on the project for such a long time. I can understand and relate to that as well.

I see that you have asked some questions in the past here in the Community, which is great. I would encourage you to please keep asking questions here. There are a lot of people ready to help out whenever possible. A lot of community members answering all kinds of questions in the Community helps out a lot of beginners like you.

So, please feel free to ask more questions related to the project and what you are stuck on and some of us can help you move forward with the project!

3 Likes

Hello .
I can’t follow why are we creating new lists and if statement is not understood well how logic works for it in the code. Following is the code:

android_clean = []
already_added = []

for app in android:
    name = app[0]
    n_reviews = float(app[3])
    
    if (reviews_max[name] == n_reviews) and (name not in already_added):
        android_clean.append(app)
        already_added.append(name) # make sure this is inside the if block

Thanks,
Ankush

Just so you know, many first-time coders struggle with this exercise. I had a zoom call over the weekend to help explain this to another learner and it helped them just to be able to talk it out with someone. I will try to duplicate that conversation by asking/answering my own questions to try to walk us through the understanding.

So let’s begin with: what is our goal here? What are we trying to do here with this code? Short answer: we want to create a (clean) list of android apps, right? But why do we even need to do that? We need to do it because what we start with is a list that has duplicate entries for some of the apps and before we do any kind of analysis on our list, we want to make sure that we have only one entry per app: NO DUPLICATES PLEASE! But if an app has duplicates, how do we decide which one to put in our android_clean list? Well, we have decided that we only want to add the one that has the most reviews (ie the value stored in the reviews_max dictionary we created in the previous step) because that’s the one we feel will be the most up to date. So how do we do that?

Well, that’s what the code inside the if statement is for! That code will check (on each iteration of the for loop) whether or not the row (ie app) corresponds to the app with the most reviews. We know this is true by comparing the number of reviews (n_reviews) to the corresponding value stored in reviews_max for the app. If the value stored in there is equal to n_reviews then we know it has the maximum number of reviews and thus it’s the one we want to add to our clean list (android_clean).

However, we also want to check if the app has already been added to our android_clean list because it’s possible that more than one duplicate in our original list has the same max number of reviews. If we didn’t do a check to see whether or not the app with n_reviews == max number of reviews has already been added to our clean list, we could end up adding the app more than once to our clean list, each one having the max number of reviews. We do this check by keeping another list: already_added. This list just keeps track of the apps we’ve already added so that we can check if it’s been added or not. If the app has max reviews but it’s already been added to android_clean, we don’t want to add it again. Alternatively, if the app has max reviews but has not already been added, we do want to add it to android_clean!

Please let me know if any of this isn’t clear and we can try something else to help you out.

1 Like

Hey Mike,

Thanks for the explanation. I had to read and re-read numerous times to understand the logic.
My question to you now how would you take this course if you are to begin learning data science again. Would you take notes in a separate notebook as the course progress?

I am eager to learn how to effectively use this course as I haven’t got used to online education.

Awaiting your reply.

Thanks.

You’re welcome. Were you able to learn from it? Did it answer your original question? If so, please consider marking the response as being the Solution to your post. Just look for the checkbox next to Solution below the response.

This is a great question and unfortunately the answer is: it depends on the person. I am not much of a note taker myself but I do like the “cheatsheets” that are provided at the end of each mission. For content that I found particularly challenging, I like to print them off and make personalized notes on them to help me remember how to perform a certain task. Adding them to a binder with sections is a great desktop reference.

That said, I have taken notes before when taking a course on completely new material that I find confusing but find I never refer to them again…although just the act of taking the notes would sometimes help me understand it “on my first pass.” So in those cases, I would say it was beneficial for me to take notes even though they essentially went straight into the fireplace once the lesson was complete.

My best advise would be to just keep practicing and experimenting. People tend to learn the most programming by writing actual code as opposed to just reading a screen or watching a video. This is why DataQuest is my preferred learning platform because it focuses on doing rather than just showing.

You might also benefit from reading an article I just posted the other day in DataQuest Direct with some tips & tricks for first-time coders. Let me know what you think.

Happy learning!

1 Like

I am not able to find the checkbox for marking as solution.

Hi, I’d love to be your study partner :slight_smile: we can discuss some lessons

My apologies @AnkushMalik, I failed to notice that this topic has been posted in the Share category and therefore does not have the option of marking a response as a solution since Question/Answer type posts do not go here. My bad.

Heads up - I just moved this topic from Share to Q&A category and marked that post as the Solution. :slight_smile:

1 Like

Hi @reginaldrenzsantos , thanks for reaching out. My email id is nkshmalik1@gmail.com . We can plan out and help each other that way.

1 Like