Data Science Unit 1

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Which of the following is not a statistical question? - How many vehicles do adults have per household in Miami? - How much money is spent on gas per year in Miami? - How many Miami residents used public transportation on Friday? - How long does it typically take a Miami resident to travel to work?

How many Miami residents used public transportation on Friday?

What is the argument of the function shown in this code snippet? def print_number(num): print(num) print_number(10) - 10 - def - num - print_number

10

What will be the output of the following code snippet? rating = 2.7 print(type(rating)) ------------------------------------------------------------------------ <class 'char'> ------------------------------------------------------------------------ <class 'float'> ------------------------------------------------------------------------ <class 'int'> ------------------------------------------------------------------------ <class 'str'> ------------------------------------------------------------------------

<class 'float'>

Which code snippet could be used to print the following series? [Brother 2004 Sister 2010 Uncle 1993 Cousin 2007 dtype: int64] ------------------------------------------------------------------------ birth_years = pd.Series(["Brother", "Sister", "Uncle", "Cousin"], index=[2004, 2010, 1993, 2007]) print(birth_years) ------------------------------------------------------------------------ birth_years = pd.Series([2004, 2010, 1993, 2007]) print(birth_years) ------------------------------------------------------------------------ birth_years = pd.Series(["Brother", "Sister", "Uncle", "Cousin"]) print(birth_years) ------------------------------------------------------------------------ birth_years = pd.Series([2004, 2010, 1993, 2007], index=["Brother", "Sister", "Uncle", "Cousin"]) print(birth_years)

birth_years = pd.Series([2004, 2010, 1993, 2007], index=["Brother", "Sister", "Uncle", "Cousin"]) print(birth_years)

How many Miami residents used public transportation on Friday? - length - cost - speed - country

country

Your school stores all of the track and field scores in a Pandas data frame. Each row represents a unique athlete. There is a column that stores the athlete's total score and another column that stores the athlete's total attempts. Which of the following functions could be used to find the average of the athlete's scores? ------------------------------------------------------------------------ def average_score(total, attempts): return total/attempts ------------------------------------------------------------------------ def average_score(total, attempts): return total - attempts ------------------------------------------------------------------------ def average_score(total): return total ------------------------------------------------------------------------ def average_score(attempts): return attempts/total ------------------------------------------------------------------------

def average_score(total, attempts): return total/attempts

Your Spanish teacher stores all of the bonus points given to students for each semester in a Pandas data frame. Each row represents a unique student. There are two columns of points. Which of the following functions can be used to find the total of all of the points? ------------------------------------------------------------------------ def total_points(total): return total ------------------------------------------------------------------------ def total_points(first, second): return first + second ------------------------------------------------------------------------ def total_points(total): return first + second ------------------------------------------------------------------------ def total_points(first, second): return total ------------------------------------------------------------------------

def total_points(first, second): return first + second

Which function will return the descriptive statistics of each column that contains quantitative data? - df.dtype - df.shape - df.head() - df.describe()

df.describe()

Which function will select the last 3 rows of the data frame? - df.tail() - df.tail(3) - df.head(3) - df[0:3]

df.tail(3)

What parameter should be added to the following function to make the change to the index permanent? students.set_index("name") - permanent=True - permanent=Yes - inplace=True - inplace=Yes

inplace=True

A collection of modules and packages that can be imported into a program is called a ______. - class - documentation - library - function

library

Which measure is best to use to avoid outliers from corrupting the average? - mean - median - mode - range

median

Which option would correctly filter a data frame to display two columns of data? - print(students[name, grade]) - print(students[[name, grade]]) - print(students["name", "grade"]) - print(students[["name", "grade"]])

print(students[["name", "grade"]])

Question: 10 Which option would correctly filter a dataframe to display students who are in 9th grade or lower? - print(students["grade"] < 9) - print(students["grade"] <= 9) - print(students[students["grade"] < 9]) - print(students[students["grade"] <= 9])

print(students[students["grade"] <= 9])

Which option would correctly create a new column by using the function graduation and the values in the grade column? - graduation(students["grade"]) - students["grade"] = graduation() - students["graduation"] = graduation(students["grade"]) - graduation["graduation"] = students(students["grade"])

students["graduation"] = graduation(students["grade"])


Kaugnay na mga set ng pag-aaral

AP Psych Ch 9 Operant Conditioning and Cognitive Learning

View Set

Ati pharmocology Detailed Answer Key (SIMPLE VERSION)

View Set

Anatomy & Physiology terminology9/14, lab 9/22

View Set

Human Anatomy and Physiology Exam 3

View Set

Montgomery Bus Boycott Article: Fill-in-the-Blanks

View Set