I am trying to create a linear model to show the relationship between a viewer's age and the total number of tv shows watched. The tv shows are dog_whisperer, dogs_101, cats_101, bad_dog, puppies_vs_babies, puppy_bowl. I think I need to total the watchers for the shows but not sure how to go about it. Below is the code I am using. I receive KeyError: ‘TOTAL_TV_WATCHED’ return self._engine.get_loc(casted_key)
I am trying to create a linear model to show the relationship between a viewer's age and the total number of tv shows watched. The tv shows are dog_whisperer, dogs_101, cats_101, bad_dog, puppies_vs_babies, puppy_bowl. I think I need to total the watchers for the shows but not sure how to go about it. Below is the code I am using. I receive KeyError: ‘TOTAL_TV_WATCHED’ return self._engine.get_loc(casted_key)
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
column_names = ["GENDER","AGE","INCOME","DOG_WHISPERER","DOGS_101","CATS_101","BAD_DOG", "PUPPIES_VS_BABIES","PUPPY_BOWL"]
data = pd.read_csv("/dbfs/FileStore/shared_uploads/xxxxxxxxxxx/modified_uverse_data.csv", sep="|", names=column_names, header=None)
X = data[['AGE']]
y = data['TOTAL_TV_WATCHED'].
Please type answer note write by hend.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps