Question
Intro to the insurance data The insurance.csv data base contains insurance information for 1338 people. The columns report the age, sex, BMI, number of children,
Intro to the insurance data
The insurance.csv data base contains insurance information for 1338 people. The columns report the age, sex, BMI, number of children, smoker status, and geographical region of each individual, as well as the insurance charges. Create dummy variables using the code here. Then, print out the head of the data frame.
import pandas as pd
ins = pd.read_csv("insurance.csv")
# Recode the column smoker into a dummy variables with the prefix smoker ins = pd.get_dummies(ins, columns=['smoker'], prefix = ['smoker'])
# Print the head of ins print(ins())
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started