Challenge 14 Megathread

For any and all questions relating to Challenge 14 :point_down: post away!

Hello! Here is pretty quiet this morning.

Kindly ask as many questions as possible, and discuss amongst yourself.

Things may be quiet because we are not able to establish a connection beyond logging in! I’ve been trying for the past 20 minutes, and I can’t get anything from the Jupyter Notebook other than “lost connection”. Using the “Run Program” button, and even reloading the page in the browser has not helped. Please check if things are running on your end, and thanks for reading!

Hi @Mayra, I’m truly sorry for the inconvenience. However, everything seems perfect on my side. Could this be an issue with connectivity?

Can anyone here confirm if they are having similar issue as @Mayra please?

I was noticing some connectivity issues, but it seemed intermittent. I was eventually able to complete the challenge after reloading the page a couple times, though I had to reenter my work.

1 Like

@buck10, oh wow. Running the cell was seamless for me. Thanks for your response!

@Mayra please try again and update us when you are able to make a submission.

Thank you for reaching out! Things seem to be stable now.

1 Like

When you accidentally submit the wrong answer because you miss clicked :frowning:

1 Like

@Kingspider :pleading_face:. I know how that feels!! Sorry. There are more challenges to go​:muscle:

I must be learning because I got the answer right… but after seeing the recommended solution I realized how many extra steps I did for the same outcome :sweat_smile: I dont want these challenges to end!

5 Likes

So, I completed the challenge and got the right answer, but I feel like there’s a much better way to complete the challenge than the method(s) I used.

Is there a way that people who completed the challenge can share and review each other’s code?

Edit: Haha, ok I see now that there are recommended solutions that are visible after the challenge is completed xD. The recommended solutions are great, but it still would be nice to share/review with others! :grin:

1 Like

I’m having intermittent connectivity too. Still. I tried restarting the browser with no luck, so I’ve just rebooted. VERY frustrating. I keep getting this messageL

#### Connection failed

A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.

I am having issues running my code as well. I have been having connectivity issues for three days now :weary:
It keeps telling me that the kernel has died and will restart automatically.

NOW I’ve submitted my answer, but I just get "LOADING…"

OK, I finally switched computers and still keep getting “kernel died” messages but managed to keep one alive long enough to input my answer. Finally got it but wasted MUCH too much time restarting the challenge page!

Is there possibly another way to access the notebook to do the challenge? I have been trying to get the program to do something, anything, for over an hour and I am still having connectivity issues. I don’t want to miss a challenge because of this. :sob:

Hi @ladyvankan,

I had some connectivity issues too. This is what I did:

  1. I downloaded the csv file
  2. I found the question and completed the challenge on google colab (a free online notebook)
  3. I submitted the answer on LHL’s notebook (the connectivity issues did not seem to affect submitting the answer)

The Question for Today’s Challenge (#14)

  1. Find the regions (variable regionName) which had the lowest amount (sum of trafficCount) of each light and heavy traffic during the year 2020. (one region for each classWeight)
  2. Using a bar chart, which month had the lowest amount of total traffic in 2020?
  3. What was the % of heavy traffic (using variable trafficCount) in New Zealand in 2020?

Where to Download the CSV File

The easiest way I think is to download it from my github. Today’s csv file is “nz_car_traffic.csv”. But all the csv files (up to today’s challenge, i.e. challenge 14) are up there. Whenever there is a new challenge, I (or someone else) will add the new csv file (if there’s a new file).
To download, click on Code and choose Download ZIP.

How to Upload the CSV to Google Colab

This is explained in the second half of this post:

Basically, you run this code:

from google.colab import files
uploaded = files.upload()

Then click on the upload button that appears, and choose the csv file you want to upload. This is a large file so it will take a few minutes (maybe 5minutes) to upload.

Then you run this code:

import pandas as pd
import io

# Replace EDIT_THIS_FILENAME.csv with the name of your csv file 
df = pd.read_csv(io.BytesIO(uploaded['EDIT_THIS_FILENAME.csv']))

Make sure to replace “EDIT_THIS_FILENAME.csv” with “nz_car_traffic.csv”.

Then you’re all set! If you are having trouble let me know or check out the original post I linked to. :grin:

3 Likes

Is it just me or is the “right” answer not the same as the solutions posted on the Notebook? They don’t seem to match on my end.

1 Like

Thank you, thank you, thank you!!! I’m in! :hugs:
And now, to complete the challenge…

1 Like

Thanks for preparing those questions to be solved by Python.
The difficult part is understanding the question correctly.
What would be the next after 21-day challenge?

1 Like