I'm going to give you a set of prompts taken from a Jupyter notebook. Each prompt…
Rate quality
Private research annotation
Sign in to add a private research label or note.
Jump to turn (11)
- 1I'm going to give you a set of prompts taken from a Jupyter notebook. Each promp
- 2Code: Set age\years to the Ageyears column of local\data\2020 age\years =
- 3Code: Set without\age to the entire local\data\2020 \without\ the Ageyears colum
- 4Code: Set without\age\numbers to a version of without\age which has all non-nume
- 5Let's say you're trying to use school census data to predict the age of a studen
- 6Code: Follow data science convention and rename your features and targets to the
- 7You want to train your model on some of the data, and test its performance on an
- 8Code: Import a DecisionTreeRegressor model and create an instance of it. Note: P
- 9Code: Train ("fit") your model on/to your training set census\model.fit(X\train,
- 10Code: Use the model to predict the age of the first student in your test set. pr
- 11Code: Calculate the score (performance) of your model on the test test. score =
- User
I'm going to give you a set of prompts taken from a Jupyter notebook. Each prompt contains a Python comment and/or a piece of Python code which needs to be filled in. Please complete each prompt.
For example: Code:
Read in the data set from "datasets/us_school_census_9-2020.csv"
local_data_2020 = local_data_2020
Answer: local_data_2020 = pd.read_csv("datasets/us_school_census_9-2020.csv") local_data_2020
Here is a new prompt: Code:
Read another data set from the path: "datasets/us_school_census_9-2019.csv"
Hint: There is something different about this data set. Try displaying it in Jupyter.
local_data_2019 =
Answer:
- Assistant
local_data_2019 = pd.read_csv("datasets/us_school_census_9-2019.csv") local_data_2019.head() # Display the first few rows of the data to check if it has loaded correctly.
- User