Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Why are physical controls over inventory assets important?

Answered: 1 week ago