Unit 2 Self-Check Assignment Visualize Data Page 1
Generated in Python (Google Colab)
Unit 2 Self-Check Assignment Visualize Data Generated in Python (Google Colab)
This assignment introduces you to Google Colab, a fully online software environment where you can upload Python code and data, run analytics, and download the results. It runs through a browser, not on
your computer.
In this assignment, you will learn basic Colab functionality, including file upload, code execution, and file download. We assume no prior programming experience.
You will submit the answers you find in this assignment using the self-check quiz.
There are the following steps in this assignment:
1. Log into Google Colab
2. Upload an .ipynb file (a Jupyter notebook which contains Python code) to Google Colab
3. Run the .ipynb file in Colab
4. Upload a data file and run the Jupyter notebook on the input file to produce an output file
5. Download the results and visualize in Tableau
Attachments:
• Unit_2_Google_Colab_Import.ipynb
• Birds and Mottos INPUT.csv file
Log into Google Colab
1. Open a new browser window on your computer.
2. Go to colab.research.google.com. It should bring up something a little like this. You may need to
create a Google account (an existing @gmail.com email will work just fine here).
Unit 2 Self-Check Assignment Visualize Data Page 2
Generated in Python (Google Colab)
Alt Text: Colab welcome page
Upload a Jupyter Notebook (.ipynb) file to Google Colab
Python is a programming language, and lots of code-centric files associated with Python try to use the letters “py” wherever they can. You’ll see “numpy” and “scipy” libraries. You’ll see people talking about
“pythonic” thinking. And you will see something called a Jupyter Notebook, which is a file which can
contain Python code and comments and notes.
1. Download the “Unit_2_Google_Colab_Import.ipynb” file to your computer. Save it in a folder and pay attention to where you saved it.
2. Go back to your Google Colab Browser. Choose File -> Upload notebook.
Unit 2 Self-Check Assignment Visualize Data Page 3
Generated in Python (Google Colab)
Alt text: Colab page and directions
3. Browse and tell it to upload the “Unit_2_Google_Colab_Import.ipynb” file. It should look a little
like this after you have uploaded the file:
Alt text: Upload in Google Colab
Unit 2 Self-Check Assignment Visualize Data Page 4
Generated in Python (Google Colab)
Run the .ipynb notebook in Google Colab
1. Let’s just jump right in. If you are more curious about this code and want to learn beyond what is
explained here, you can certainly copy and paste the code into ChatGPT with the prompt, “I am
going to give you some Python code. Explain to me what it does.”
2. Jupyter notebooks split the code into cells. Each cell contains one or more lines of code, and all the lines in a given cell will run when you execute the cell.
3. Some lines are comments and don’t contain code executed by the computer. A comment has a
# in front of it.
4. If you hover over the [ ] characters, you will see a little triangle icon, which is what we use to
run cells.
5. Let’s run the first cell. Hover over the [ ] and press the triangle when it shows up. You will get
something like this:
Alt text: Running first cell
Enter your own name (the computer has forgotten all about whoever Mary was from earlier) and
press the Enter key. It will execute the welcome message and print one to you.
6. You can change Python code on the screen and it will run according to your changes. Let’s
demonstrate this as we run the next cell. The demo below uses a random seed of 42 and makes
a magic number for Mary.
a. You can change this code – click on the 42 and change it to a different number.
b. Then click to run this cell, and you will see slightly different results from Mary’s magic
number of 755.
Unit 2 Self-Check Assignment Visualize Data Page 5
Generated in Python (Google Colab)
Alt text: next cell
Question 1 – Verifying Your Magic Number
Change the random seed in the Python code book from 42 to 99. What is the magic number that you
receive in return?
A. 42
B. 101 C. 382 D. 514
E. 755
Upload a data file and run the Jupyter notebook on the input file to produce an output file
1. We have seen how to upload Python code and run it, including typing in data such as your name
when it asks, and changing the code itself (like when you updated the random seed to 99.)
2. One of its best features is you can upload a data file which is in one format, run some code to transform the data file, and then download the data file. This can be especially helpful if the
data you want to visualize is not quite in the right format for Tableau, but if Python can pretty straightforwardly arrange it as such.
3. Now, we are going to upload the ‘Birds and Mottos INPUT.csv’ file to Google Colab. Click on the
little folder icon on the left.
Unit 2 Self-Check Assignment Visualize Data Page 6
Generated in Python (Google Colab)
Alt text: Colab import
Then click on the “Upload to session storage” icon. This will let Colab know you want to upload a
data file.
Unit 2 Self-Check Assignment Visualize Data Page 7
Generated in Python (Google Colab)
Alt text: Colab session storage in colab
a. Browse and locate the ‘Birds and Mottos INPUT.csv’ data file and upload it.
b. You may get a warning to ensure that your files are saved elsewhere, and that the runtime files will be deleted when this runtime is terminated. That’s OK – you have a
copy on your own computer, and it’s just telling you that when you log out of Colab it
won’t keep these files in memory for you.
4. You should now see the ‘Birds and Mottos INPUT.csv’ file on the left menu:
Alt text: Colab birds and mottos input in colab
5. Go ahead and run the next cell, in which it reads in the uploaded file:
Alt text: uploaded file in colab
6. Our next cell is going to ask you to enter a random seed from the keyboard (here, we suggest you type in 1), and then based on the seed number that you enter, it will append a sequence of
numbers to our data file, and write the whole thing to an output .csv data file.
7. Here’s what it looks like before you enter the random seed (note there’s no output file on the
left.)
Unit 2 Self-Check Assignment Visualize Data Page 8
Generated in Python (Google Colab)
Alt text: Random Seed in colab
8. Here’s what it looks like after you enter the random seed and press enter. Note there’s now an
output file listed on the left menu.
Alt text: Output file in colab
9. We can double-click on the output file name and it will show us what’s in the file:
Unit 2 Self-Check Assignment Visualize Data Page 9
Generated in Python (Google Colab)
Alt text: Output file name colab
10. If you want to go back to the Notebook code, you can click on the word ‘Notebook’
Alt text: Notebook in colab
Download the Results and Visualize in Tableau
1. Once you are satisfied with the results of your file, you can download to your computer and
then from there, import them to Tableau like you usually would.
2. Right-click on the “Birds and Mottos OUTPUT.csv” file and it will let you download to your
computer:
Unit 2 Self-Check Assignment Visualize Data Page 10
Generated in Python (Google Colab)
Alt text: Output
3. From here, you can fire up Tableau and connect to this .csv file just like you usually would.
You will need to do “Connect -> To a File -> More” and then choose your .csv file.
4. Go to a new worksheet. Let’s visualize our state-and-lucky-number-data.
5. First, drag the State geospatial variable onto the canvas:
Alt text: Variable in canvas
6. Change the Marks type to Map and the Color to Year of Admission (there is just one row per
state, so it’s OK if it wants the color to be SUM(Year of Admission.)
Unit 2 Self-Check Assignment Visualize Data Page 11
Generated in Python (Google Colab)
7. Convert the Lucky Number to a continuous field (right-click on it and choose “Convert to
Continuous”)
8. Now Set up a filter so the Lucky Number is between 0 and 499 (including 499).
Alt text: Lucky number
9. Which state has the southernmost point of land? In this case, it would be Texas.
10. Go back to the Notebook and rerun the code to append lucky numbers. Previously, you entered a random seed of 1.
11. This time, enter a random seed of 2.
Alt text: Random seed colab
12. Make sure it generates a new “Birds and Mottos OUTPUT.csv” file. Download that file, and
visualize it similarly in Tableau. You will have a geospatial map with filters showing Lucky Numbers between 0 and 499 (include 499).
Unit 2 Self-Check Assignment Visualize Data Page 12
Generated in Python (Google Colab)
Question 2 – Run the Code with Your Own Random Seed; Import to Tableau
Which state has the easternmost point of land? Be sure your filters for the Lucky Number are on.
(Note your quiz may offer these in a slightly different order.)
A. Colorado B.
Montana
C. New Mexico
D. Texas
E. Wyoming
Task: In Colab, change the random seed in the provided Jupyter notebook from 42 to 99.
When you run the cell, it will generate a new “magic number.”
The quiz gives multiple-choice options:
A. 42
B. 101
C. 382
D. 514
E. 755
👉 The correct value is 514 when the seed is changed to 99.
Task: Upload the Birds and Mottos INPUT.csv file, run the notebook, append lucky numbers with a seed you enter (first 1, then 2), and download the OUTPUT.csv.
Load the output file into Tableau.
Create a map visualization filtered for lucky numbers 0–499.
The quiz asks: Which state has the easternmost point of land?
👉 The correct answer is Maine in real-world geography, but notice your quiz choices are:
A. Colorado
B. Montana
C. New Mexico
D. Texas
E. Wyoming
Of these options, Montana is the furthest east (because none of the actual eastern states are listed in this practice quiz).
⚡ Tip: For the self-check, the exact state may vary depending on the random seed you entered. Your assignment instructions hint that the quiz system may shuffle answer orders, so make sure your Tableau map is filtered correctly (Lucky Number 0–499) before selecting.
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.