Solution 13.1
Perform the following steps to complete the activity:
- For this activity, you will need the
pandas
library, thematplotlib.pyplot
library, and thesklearn.linear_model.LinearRegression
module. Load them in the first cell of the notebook:import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression
- Read in the
bike_share.csv
data from theDatasets
directory and list the first five rows using.head()
:rental_data = pd.read_csv('../Datasets/bike_share.csv') rental_data.head()
This produces the following:
- You need to create a datetime index. Begin by creating a column that combines the date and hour strings into a datetime-like string, and then convert that string to a datetime, storing the result in a column. Finally, set the index to the new column, so there is a datetime index:
rental_data['date_time&apos...