df.set_index('runtime')
Will need to use pd.to_numeric here.
df.set_index('runtime')
Will need to use pd.to_numeric here.
101
Actually row 99.
countries
This should be "regions" - you should sort the list of unique regions that you have just generated.
x)
This should be .xcor(), not .x
that the object knows about itself
Perhaps - "that can be known about the object" (an object doesn't know about itself).
variance
Variance of the x (i.e., diameters)
To do this we will follow these steps: Pick a random value for m and b Compute the MSE for all our known points Repeat the following steps 1000 times 1. Make m slightly bigger and recompute the MSE does that make it smaller? If so then use this new value for m. If it doesn’t make MSE smaller than make m slightly smaller and see if that helps. 1. Make b slightly bigger and recompute the MSE does that make it smaller? If so then use this new value for b and go back to step 3a. If not then try a slightly smaller b and see if that makes the MSE smaller if so keep this value for b and go back to step 3a. After repeating the above enough times we will be very close to the best possible values for m and b. We can now use these values to make predictions for other pizzas where we know the diameter but don’t know the price.
Do this in Activity 5, not Activity 4.
This shoudl use compute_y
This phrase should be "(this should use compute_y)" - i.e., in parentheses.
Make a bar chart that shows the total amount of money loaned in each country. Save & RunLoad HistoryShare Code
One will need to preprocess the data to determine the totals first before feeding it into Altair here (or use color).
to the encoding
When you add the color parameter, it should be a scatter plot (mark_point) rather than a line plot.
Write code that asks the user to input a year and output True if it’s a leap year, or False otherwise. Use if statements.
Rewrite: you are provided with a list years of integers; create another list is_leap_year of boolean variables telling whether the corresponding integers in years are leap years or not. You don't need to ask the user for input.
Level 1 Questions¶
You may need to consult https://en.wikipedia.org/wiki/Standard_deviation for some definitions.
What is a function in Python?
Kind of a vague question with a vague answer.
variable
As a list
LogisticRegression
We don't use this now.
raining and test data
This should be the test and the predicted data, not the training and test data.
9.14.2. Evaluating the Model
Note that 9.14.2 and 9.14.3 are just comments about what you will be doing in 9.14.4, below.
import pandas as pd stations = pd.read_csv("https://media.githubusercontent.com/media/RunestoneInteractive/httlads/master/Data/bikeshare_stations.csv") stations.head()
Upload the bikeshare.db file into Colab first, then use the following:
import pandas as pd stations = pd.read_sql_query("""select * from bikeshare_stations where latitude is not NULL""",'sqlite:///bikeshare.db') stations.head()
9.8
9.9
stations = pd.read_csv("https://media.githubusercontent.com/media/RunestoneInteractive/httlads/master/Data/bikeshare_stations.csv")
The link is broken; just use the code above to create the stations DataFrame.
computed?
Don't include the "64"
narrow representation of the data
That is, the long form of the data (not the pivot table).
all countries across all years.
Below, they suggest limiting yourself to 12 related countries.
What percentage is that?
Leave as a decimal value, rounded to the hundredths.
nx
Need to "import networkx as nx" first.
On Colab, I needed to run the following:
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout
!apt install libgraphviz-dev
!pip install pygraphviz
graphvix_
graphviz, not graphvix
score_text
I think analyzer.polarity_scores does this already
alt.Chart(undf).mark_bar().encode(x=X('sentiment', bin=True), y='count()')
If running in Colab, use the following code alt.data_transformers.disable_max_rows() alt.Chart(undf[['year','sentiment']]).mark_bar().encode(x=alt.X('sentiment', bin=True), y='count()')
make sure you use extractall
The answer here is probably incorrect.
have a country code that starts with ‘M’?
'start with "M"', not "have a country code that starts with "M"'.
title
Of the three possible answers that I got, only two of them were counted as correct here.
il
Same comment: ir, not il.
il'
Typo: should be an "ir" (interest rate) not "il".
Starting_a_business score
There's a missing underscore here: Starting_a_Business_score
Paste the following URL in your web browser: https://restcountries.eu/rest/v2/alpha/usa and make a request
No need to do this - just paste the code below into Jupyter lab. (Pasting this in the browser will retrieve the same data that you retrieve in the code block below.)
(wd.protecting_minority_investors_score < 50).head(20)
The output does not seem to be correct here.
ranked
top-ranked (in the starting a business score)
two-letter country code
The two-letter country codes can be found in the "Administrative Divisions" file.
Q-4: What is the average value for the column Infant mortality rate, to two significant digits?
The book's answer might be wrong here.
my_vote
this should be my_votes, not my_vote
list like
list-like
budget_lookup = []
You may need to do this in two lines of code.
How many movies with a budget of over a million dollars and whose title starts with an “A” or a “B” are there?
If you get 881, you've used "original_title" as your index. Instead use "title".
I have figured out
Using the code below
from a local file
Note that your file path will depend on where you downloaded your file.
pages
sections (3.00-3.03)
Q-3: Which two factors have the largest negative correlation?
Note that both words in the titles need to be capitalized (even if not capitalized in the sheet).
Q-2: Which two factors have the largest positive correlation (not including the diagonal)?
Must be in a particular order (the reverse order is marked as wrong)
cheaters
players (not all are cheaters)
class
CSS class
is
typo
vega_datasets
Run "pip install vega_datasets" on the command line
import psycopg2 import textatistic
These two modules don't appear to be used in this section.
less than 10 minutes (you can’t get into it if it’s too short) or longer than 3 hours
Has to be >= 10 and <= 180 (or <180) to get an answer that the books considers correct
movie
Use the 'title' rather than the 'original_title' in order to get the correct count later on.
matrix
Of the 2017 data
Q-3: Which two factors have the largest negative correlation?
Runestone marks incorrect if it's in the "reverse" order.
Q-2: Which two factors have the largest positive correlation (not including the diagonal)?
Must be put in order (i.e., if in "reverse" order, Runestone marks it as incorrect).