Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 30 pages
Exam (elaborations)

Data Science Exam 1 and II with Complete Solutions

Document preview thumbnail
Preview 3 out of 30 pages

Data Science Exam 1 and II with Complete Solutions

Content preview

Data Science Exam 1 and II with
Complete Solutions
A is a two-dimensional array of integer numbers 50000x50000; B is a one-dimensional
array of 30000 floating-point numbers; C is a floating-point number. Which of the
following operations are valid? (Check all that applies.)


Answers:

A+C

C*A.T

B*C

A/B - ANSWER-B*C
A+C
C*A.T

A NumPy array a contains both numbers and nans. Hows does the function
numpy.sort(a) with the default parameters handle the nans?


Answers:

The nans are moved to the end of the array.

The nans are moved to the beginning of the array.

The nans are discarded from the array.

The function raises an exception. - ANSWER-The nans are moved to the end of the
array.

Alice noticed that the scatter plot of variable Y vs variable X that she plotted as a part of
the exploratory data analysis, looks almost like a straight diagonal line. What statement
is Alice entitled to make, based on this observation?

Answers:
A change in X causes a change in Y.

X and Y are correlated.

,A change in Y causes a change in X.

A change in X causes a change in Y and a change in Y causes a change in X. -
ANSWER-X and Y are correlated.

Alice obtained a list of all elevators in NYC for the purpose of checking which part of the
city has most high-capacity elevators. She imported the list as a Pandas Frame and
learned that it has the following columns: Capacity; Date of last inspection; Elevation;
Building ZIP code; Building latitude; Building longitude; Building street address. About
80% of values in the "Building street address" and "Bulding ZIP code" columns are
missing. What is Alice's best policy for handling the missing values?


Answers:
Eliminate all rows with missing values.

Eliminate all columns with missing values.

Infer the street address from the longitude and latitude.

Replace all missing street addresses with some default value (say, "11 Wall Street"). -
ANSWER-Infer the street address from the longitude and latitude.

Alice uses BeautifulSoup to process an HTML document. She expects that the tag
<div>, that defines a certain division of the document (<div>...</div>), has an attribute
class, and would like to extract the class name. The division tag is in the variable
fragment. Which expression correctly obtains the class name and stores it in the
variable c?

Answers:
c=fragment.get("class")

c=div["class"]

if fragment.has_attr("class"): c=fragment["class"]

fragment.find(div="class") - ANSWER-if fragment.has_attr("class"): c=fragment["class"]

Alice uses BeautifulSoup to process an HTML document. She expects that the tag <p>,
that defines a paragraph within the document (<p>...</p>), has an attribute class, and
would like to extract the class name. The paragraph tag is in the variable fragment.
Which expression correctly obtains the class name and stores it in the variable c?


Answers:

, c=fragment["class"]

fragment.find(p="class")

if fragment.has_attr("class"): c=fragment["class"]

c=p["class"] - ANSWER-if fragment.has_attr("class"): c=fragment["class"]

Alice works for United Airlines (UA). She was asked to predict the overbooking of a
flight (True or False), based on the probability of a UA crew member needing to fly to
the same destination for another flight (one continuous variable in the range 0 through
1). Which models shall Alice use to make the prediction? (Check all that applies.)

Answers:
Linear regression

Ridge regression

Random forest classifier

Logistic regression - ANSWER-Random forest classifier
Logistic regression

An aircraft circles around an airport, waiting for a permission to land, staying at a
constant distance of 10 miles from the landing strip. What is the relationship between
the coordinates X and Y (or latitude and longitude) of the aircraft?


Answers:
They are correlated, but the correlation is not linear.

They are not correlated at all.

They are linearly correlated.

Not possible to tell. - ANSWER-They are correlated, but the correlation is not linear.

Array texmex contains the numbers of people crossing the border between Texas and
Mexico in both directions, by day. The number is positive if more people enter Texas
and negative if more people enter Mexico. Assuming that on day 0 the population of
Mexico was 0 and there is no way to enter Mexico other than from Texas, which
expression calculates the array that contains the total population of Mexico, by day?


Answers:
texmex.sum()

Document information

Uploaded on
October 22, 2024
Number of pages
30
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CLOUND
3.9
(128)
Sold
657
Followers
389
Items
12273
Last sold
3 weeks ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions