Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python!! 1.Importing Python modules Modules (sometimes called packages or libraries ) help group together related sets of tools in Python. In this exercise, we'll

In Python!!

1.Importing Python modules

Modules (sometimes called packages or libraries) help group together related sets of tools in Python. In this exercise, we'll examine two modules that are frequently used by Data Scientists:

  1. statsmodels: used in machine learning; usually aliased as sm
  2. seaborn: a visualization library; usually aliased as sns

Note that each module has a standard alias, which allows you to access the tools inside of the module without typing as many characters. For example, aliasing lets us shorten seaborn.scatterplot() to sns.scatterplot().

# Use an import statement to import statsmodels ____ ____ 2.

In this exercise, we'll learn to import numpy, a module for performing mathematical operations on lists of data. The standard alias for numpy is np.

What did you need to change to make the import run without errors?

# Fix the import of numpy to run without errors import NumPy as np

3.

Creating a float

Before we start looking for Bayes' kidnapper, we need to fill out a Missing Puppy Report with details of the case. Each piece of information will be stored as a variable.

We define a variable using an equals sign (=). For instance, we would define the variable height:

height = 24 

In this exercise, we'll be defining bayes_age to be 4.0 months old. The data type for this variable will be float, meaning that it is a number.

# Fill in Bayes' age (4.0) ____

# Display the variable bayes_age ____(____)

4.

Creating strings

Let's continue to fill out the Missing Puppy Report for Bayes. In the previous exercise, we defined bayes_age, which was a float, which represents a number.

In this exercise, we'll define favorite_toy and owner, which will both be strings. A string represents text. A string is surrounded by quotation marks (' or ") and can contain letters, numbers, and special characters. It doesn't matter if you use single (') or double (") quotes, but it's important to be consistent throughout your code.

# Bayes' favorite toy ____

# Bayes' owner ____

# Display variables print(favorite_toy) print(owner)

Please help out~~

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

9. Identify the woman as the temptress stage in Basic Instinct.

Answered: 1 week ago

Question

- 1 2 0 in 1 2 bit hexadecimal form

Answered: 1 week ago

Question

Explain how HR serves as a strategic business partner.

Answered: 1 week ago

Question

Describe a social audit.

Answered: 1 week ago

Question

Describe ethics training.

Answered: 1 week ago