Data Science Quiz Questions

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which provides a managed Jupyter experience, so that you don't need to run notebook servers yourself? A. GCP Datalab B. GCP Big Query C. IPython D. gsutil

A. GCP Datalab

Which command will allow you to change directory? A. cd B. ps -ax C. pwd D. ls

A. cd

Among the following, which ones are considered a part of the "architecture" of a neural network? A. number of hidden units in each hidden layer B. learning rate C. batch size D. number of iterations

A. number of hidden units in each hidden layer

Which of the following is a valid name? A. 9X B. 8+9 C. import D. mile1

D. mile1

Every continuous function of several variables defined on the unit cube can be represented as a superposition of continuous functions of one variable and the operation of addition. A. true B. false

A. true

The first four-species calculating machine, which means that it is able to perform all four basic operations of arithmetic, was built by Von Neumann. A. True B. False

B. False

n1-standard-1 is: A. a GCP region B. a GCP machine type C. a GCP availability Zone D. GCS Standard Storage (free tier)

B. a GCP machine type

What is the output of the following program : print("Hello World"[::-1]) A. l B. d C. dlroW olleH D. Hello Worl

C. dlroW olleH

You have just written error handling into your count_entries() function so that, when the user passes the function a column (as 2nd argument) NOT contained in the DataFrame (1st argument), a ValueError is thrown. You're now going to play with this function: it is loaded into pre-exercise code, as is the DataFrame tweets_df. Try calling count_entries(tweets_df, 'lang') to confirm that the function behaves as it should. Then call count_entries(tweets_df, 'lang1'): what is the last line of the output?

'ValueError: The DataFrame does not have a lang1 column.'

After executing import builtins in the IPython Shell, execute dir(builtins) to print a list of all the names in the module builtins. Have a look and you'll see a bunch of names that you'll recognize! Which of the following names is NOT in the module builtins?

'array'

Consider the Python code below: # area variables (in square meters) hall = 11.25 kit = 18.0 liv = 20.0 bed = 10.75 bath = 9.50 # house information as list of lists house = [["hallway", hall], ["kitchen", kit], ["living room", liv], ["bedroom", bed], ["bathroom", bath]] What will house[-1][1] return? A. string: "bathroom" B. A float: the bathroom area C. A float: the kitchen area D. A string: "kitchen"

B. A float: the bathroom area

Choose the correct response to fill in the blank: The HTML code below creates ______. <ul> <li>item</li> <li>Another item</li> <li>Yet another item</li> </ul> A. an ordered list B. an unordered list C. three paragraphs D. a dictionary

B. an unordered list

Recall from the video in this module "Steps of Machine Learning" there were 7 steps introduced. Which of the following is not one of these steps? A. training B. prediction C. execution D. validation

C. execution

A feedforward neural network is what type of function? A. activation function B. Python function C. multi-variable real-valued function D. threshold function

C. multi-variable real-valued function

You're a professor in Data Analytics with Python, and you want to visually assess if longer answers on exam questions lead to higher grades. Which plot do you use?

Scatter plot

Take a look at the following function calls to len(): len('There is a beast in every man and it stirs when you put a sword in his hand.') len(['robb', 'sansa', 'arya', 'eddard', 'jon']) len(525600) len(('jaime', 'cersei', 'tywin', 'tyrion', 'joffrey'))

The call len(525600) raises a TypeError.

How would you write a lambda function add_bangs that adds three exclamation points '!!!' to the end of a string a? How would you call add_bangs with the argument 'hello'?

The lambda function definition is: add_bangs = (lambda a: a + '!!!'), and the function call is: add_bangs('hello').

doctor = ['house', 'cuddy', 'chase', 'thirteen', 'wilson'] range(50) underwood = 'After all, we are nothing more or less than what we choose to reveal.' jean = '24601' flash = ['jay garrick', 'barry allen', 'wally west', 'bart allen'] valjean = 24601 You can build list comprehensions over all the objects except the string of number characters jean. You can build list comprehensions over all the objects except the string lists doctor and flash . You can build list comprehensions over all the objects except range(50). You can build list comprehensions over all the objects except the integer object valjean.

You can build list comprehensions over all the objects except the integer object valjean.

Fill in the blanks in the same order as they appear in the code: # Import cars data import pandas as pd cars = pd.read_csv('cars.csv', index_col = 0) # Create car_maniac: observations that have a cars_per_cap strictly greater than 500 cpc = cars['cars_per_cap'] [blank1] = cars[cpc [blank2] 500] # Print car_maniac print(car_maniac)

car_maniac, >

areas = ["hallway", 11.25, "kitchen", 18.0, "chill zone", 20.0, "bedroom", 10.75, "bathroom", 10.50, "poolhouse", 24.5, "garage", 15.45] Which would remove the poolhouse string and float? del(areas[10]); del(areas[11]) del(areas[10:11]) del(areas[-4:-2]) del(areas[-3]); del(areas[-4])

del(areas[-4:-2])

Fill in the blanks in the same order as they appear in the code: # Import cars data import pandas as pd cars = pd.read_csv('cars.csv', index_col = 0) # Extract drives_right column as Series named dr [blank1] = cars['drives_right'] == True # Use dr to subset cars: sel sel = cars[[blank2]] # Print sel print(sel)

dr, dr

In this exercise, you will practice what you've learned about scope in functions. The variable num has been predefined as 5, alongside the following function definitions: def func1(): num = 3 print(num) def func2(): global num double_num = num * 2 num = 6 print(double_num) Try calling func1() and func2() in the shell, then answer the following questions: What are the values printed out when you call func1() and func2()? What is the value of num in the global scope after calling func1() and func2()?

func1() prints out 3, func2() prints out 10, and the value of num in the global scope is 6.

Fill in the blanks in the same order as they appear in the code: # Pre-defined lists names = ['United States', 'Australia', 'Japan', 'India', 'Russia', 'Morocco', 'Egypt'] dr = [True, False, False, False, True, True, True] cpc = [809, 731, 588, 18, 200, 70, 45] # Import pandas as pd [blank1] pandas as pd # Create dictionary my_dict with three key:value pairs: my_dict my_dict = { 'country': names, 'drives_right': dr, 'cars_per_cap': cpc } # Build a DataFrame cars from my_dict: cars cars = [blank2].DataFrame([blank3])

import, pd, my_dict

area = 10.0 if(area < 9) : print("small") elif(area < 12) : print("medium") else : print("large") What will the output be if you run this piece of code in the IPython Shell?

medium

object1 = "data" + "analysis" + "visualization" object2 = 1 * 3 object3 = "1" * 3 What are the values in object1, object2, and object3, respectively?

object1 contains "dataanalysisvisualization", object2 contains 3, object3 contains "111".

Assign str(x) to a variable y1: y1 = str(x) Assign print(x) to a variable y2: y2 = print(x) Check the types of the variables x, y1, and y2. What are the types of x, y1, and y2?

x is a float, y1 is a str, and y2 is a NoneType.

Fill in the blanks in the same order as they appear in the code # Create a zip object from mutants and powers: z1 z1 = [blank1](mutants, powers) # Print the tuples in z1 by unpacking with * print([blank2]z1)

zip, *

Can you tell which ones of the following lines of Python code are valid ways to build a list? A. [1, 3, 4, 2] B. [[1, 2, 3], [4, 5, 7]] C. [1 + 2, "a" * 5, 3] A, B and C B B and C C

A, B and C

Can you tell how many printouts the following while loop will do? x = 1 while x < 4 : print(x) x = x + 1 A. 3 B. 0 C. 1 D. 2

A. 3

ASCII is an acronym for what? A. American Standard Code for Information Interchange B. Application Standard Code Two

A. American Standard Code for Information Interchange

Which best describes the difference between list comprehensions and generators? List comprehensions and generators are not different at all; they are just different ways of writing the same thing. A list comprehension produces a list as output, a generator produces a generator object. A list comprehension produces a list as output that can be iterated over, a generator produces a generator object that can't be iterated over.

A list comprehension produces a list as output, a generator produces a generator object.

have a look at the following piece of Python code: x = 8 y = 9 not(not(x < 3) and not(y > 14 or y > 10)) What will the result be if you execute these three commands in the IPython Shell? Notice that not has a higher priority than and and or, it is executed first. A. False B. True C. Running these commands will result in an error. D. The code above will not return a boolean.

A. False

What will the output of the bash command below be? echo $HOME A. The file path of the home directory B. $HOME $HOME C. $HOME D. The $ will cause a syntax error

A. The file path of the home directory

The following list has been pre-loaded in the environment. doctor = ['house', 'cuddy', 'chase', 'thirteen', 'wilson'] How would a list comprehension that produces a list of the first character of each string in doctor look like? Note that the list comprehension uses doc as the iterator variable. What will the output be? A. The list comprehension is [doc[0] for doc in doctor] and produces the list ['h', 'c', 'c', 't', 'w']. B. The list comprehension is [for doc in doctor: doc[0]] and produces the list ['h', 'c', 'c', 't', 'w']. C. The list comprehension is [doc[0] in doctor] and produces the list ['h', 'c', 'c', 't', 'w']. D. The list comprehension is [doc[1] in doctor] and produces the list ['h', 'c', 'c', 't', 'w'].

A. The list comprehension is [doc[0] for doc in doctor] and produces the list ['h', 'c', 'c', 't', 'w'].

You are not charged for additional instance usage while the instance is in a stopped state. A. True B. False

A. True

In the assigned reading we read about Snow's Grand Experiment. Below is an excerpt: "Snow's brilliance lay in identifying two groups that would make his comparison clear. He had set out to establish a causal relation between contaminated water and _____ , and to a great extent he succeeded, even though the miasmatists ignored and even ridiculed him." What is the missing text? A. cholera infection B. flu infection C. bone cancer

A. cholera infection

Suppose that you use the command datalab create arbok and then you use the command datalab stop arbok What would be the correct command to enter in the cloud shell to start the instance arbok again and connect to it? A. datalab connect arbok B. datalab create arbok C. datalab start arbok D. None of the above, it would be necessary to use both the datalab start and the datalab connect commands to accomplish this.

A. datalab connect arbok

Suppose we want countries who have more beer servings than the mean beer_servings, which is the best choice? A. drinks[drinks.beer_servings > drinks.beer_servings.mean()] B. drinks[drinks.beer_servings] > drinks.beer_servings.mean() C. drinks['beer_servings'] > drinks.beer_servings.mean() D. drinks[beer_servings] > 186.5

A. drinks[drinks.beer_servings > drinks.beer_servings.mean()]

Write the text "blah" to the file ~/Desktop/motivation A. echo "blah" > ~/Desktop/motivation B. echo "blah" | ~/Desktop/motivation C. print "blah" > ~/Desktop/motivation D. print "blah" | ~/Desktop/motivation

A. echo "blah" > ~/Desktop/motivation

What's the opposite of git clone, instead of downloading your code from GitHub, uploads your changes and code back to GitHub? A. git push B. git status C. git add D. git upload

A. git push

Among the following, which ones are "hyperparameters" of a neural network? A. learning rate B. the weights in the neural network C. number of hidden units in each layer D. number of hidden layers

A. learning rate

From the data that professor Hans Rosling used to build his beautiful bubble chart, two lists are available for you: life_exp which contains the life expectancy for each country and gdp_cap, which contains the GDP per capita (i.e. per person) for each country expressed in US Dollars. GDP stands for Gross Domestic Product. It basically represents the size of the economy of a country. Divide this by the population and you get the GDP per capita. To build a line chart, gdp_cap on the x-axis, life_exp on the y-axis, which of the following is the correct code: A. plt.plot(gdp_cap, life_exp) B. plt.plot(life_exp, gdp_cap) C. plt.show(gdp_cap, life_exp) D. plt.show(life_exp, gdp_cap)

A. plt.plot(gdp_cap, life_exp)

Whether a neural network is considered "deep" or not depends upon A. the number of hidden layers B. the number of hidden units C. the number of different activation functions used D. the number of variables input to the model

A. the number of hidden layers

What does "VM instances" stand for? A. virtual machine instances B. variable memory instances C. virtual mac instances D. virtual memory instances

A. virtual machine instances

Once you have created a GCP persistant disk, approximately how much will it cost you to store data in your bucket? A. About $5 per GB per month B. About $0.05 (5 cents) per GB per month C. About $50 per GB per month D. About $0.5 (50 cents) per GB per month

B. About $0.05 (5 cents) per GB per month

By definition, a neural netowrk is a composition of __ functions and ReLU functions? A. Linear B. Affline

B. Affline

What is Data Science? Multiple answers to this question were given both in lecture and the assigned reading. Which of the following was not one of these answers? A. Data Science is about drawing useful conclusions from large and diverse data sets through exploration, prediction, and inference. B. Data Science is the science of analyzing large data sets C. Data Science is the automatic (or semi-automatic) extraction of knowledge from data.

B. Data Science is the science of analyzing large data sets

What will be the result of the query below? SELECT plurality FROM 'publicdata.samples.natality' WHERE year > 2000 LIMIT 10 A. Last ten entries from the "plurality" column where the year of birth is greater than 2000 B. First ten entries from the "plurality" column where the year of birth is greater than 2000 C. First ten entries from the "plurality" column where the year of birth is between 2000 and 2010 D. If year is less than 2000, then the code does not execute, but if year is greater, the query is executed and the first ten entries from the "plurality" column are returned,

B. First ten entries from the "plurality" column where the year of birth is greater than 2000

You're a professor teaching Data Science with Python, and you want to visually assess if the grades (A, A-, B+, etc.) on your exam follow a particular distribution. Which plot do you use? A. Scatter Plot B. Histogram C. Line plot

B. Histogram

What is the output of the following Python code? a = 500 b = 500 a == b A. False B. True C. The premise of the question is false, a == b is not Python code

B. True

Suppose that you create a new GCP bucket and upload a picture, sheep.jpg, to the bucket. If you want a link to the picture so that you may, for instance, share the picture with a friend, you must: A. do nothing, objects are public by default B. configure permissions on your object so that it is publicly accessible C. change the instance type to high-mem D. The premise of the question is false: one cannot share files in a bucket

B. configure permissions on your object so that it is publicly accessible

import pandas as pd drinks = pd.read_csv('https://raw.githubusercontent.com/justmarkham/DAT5/master/data/drinks.csv') Suppose we want to show European countries or countries with 'wine_servings' greater than 300, which is the best choice? A. drinks[(drinks.continent=='EU') & (drinks.wine_servings > 300)] B. drinks[(drinks.continent=='EU') | (drinks.wine_servings > 300)] C. drinks[drinks.wine_servings > 300] | drinks[drinks.continent == 'EU'] D. drinks[drinks.continent=='EU'].wine_servings.greater(300)

B. drinks[(drinks.continent=='EU') | (drinks.wine_servings > 300)]

What's the git command that downloads your repository from GitHub to your computer? A. git push B. git clone C. git fork D. git commit

B. git clone

Have a look at this line of code: np.array([True, 1, 2]) + np.array([3, 4, False]) Can you tell which code chunk builds the exact same Python object? The numpy package is already imported as np, so you can start experimenting in the IPython Shell straight away! A. np.array([True, 1, 2, 3, 4, False]) B. np.array([4, 3, 0]) + np.array([0, 2, 2]) C. np.array([1, 1, 2]) + np.array([3, 4, -1]) D. np.array([0, 1, 2, 3, 4, 5])

B. np.array([4, 3, 0]) + np.array([0, 2, 2])

Which of the following is true of the id() function in python? A. returns the value of the object B. returns the integer representing the identity of the object C. returns the type of the object D. returns all of the above

B. returns the integer representing the identity of the object

Which one of these will throw an error? A. "I can add integers, like " + str(5) + " to strings." B. "I said " + ("Hey " * 2) + "Hey!" C. "The correct answer to this multiple choice exercise is answer number " + 2 D. True + False

C. "The correct answer to this multiple choice exercise is answer number " + 2

Convert F2 from hexadecimal to binary. A. 11100010 B. 10110010 C. 11110010 D. 11010010

C. 11110010

What is the output of the following bash code? ls / | grep ".txt" A. The code will cause an error, it should be written grep ".txt" | ls / B. All "/" characters in grep are replaced by .txt C. All .txt files in root D. The code will cause an error, it should be written grep ".txt" ls / |

C. All .txt files in root

For which of the following does x have an int type (python 3.xx)? A. x = 13 % 2 B. x = int(13 / 2) C. For all choices D. x = 13 // 2

C. For all choices

When you execute the following python code, what happens? 4 = 2 + 2 A. 4 is stored as the name for 2 + 2 B. Nothing C. SyntaxError: can't assign to literal

C. SyntaxError: can't assign to literal

What is the output? x = 'Data science' x[0] = 'd' print(x) A. data Science B. data science C. TypeError: 'str' object does not support item assignment D. dData Science

C. TypeError: 'str' object does not support item assignment

What does URL stand for? A. Uniform Record Layer B. (U)nited w(R)iting (L)anguage C. Uniform Resource Locator D. Ultimate Request Live

C. Uniform Resource Locator

After completing the tasks in a GitHub issue, the next step is to ______ A. fetch the issue B. git clone C. close the issue D. merge the issue

C. close the issue

Have a look at this line of code: np.array([True, 1, 2]) + np.array([3, 4, False]) Can you tell which code chunk builds the exact same Python object? A. np.array([True, 1, 2, 3, 4, False]) B. np.array([1, 1, 2]) + np.array([3, 4, -1]) C. np.array([4, 3, 0]) + np.array([0, 2, 2]) D. np.array([0, 1, 2, 3, 4, 5])

C. np.array([4, 3, 0]) + np.array([0, 2, 2])

Choose the code that will be the least expensive (or free) to execute. A. %%bq query SELECT title FROM `publicdata.samples.wikipedia` ORDER BY timestamp B. %%bq query SELECT title, timestamp FROM `publicdata.samples.wikipedia` ORDER BY timestamp LIMIT 10 C. %%bq query SELECT title, timestamp FROM `publicdata.samples.wikipedia` ORDER BY timestamp D. %%bq dryrun SELECT title, timestamp FROM `publicdata.samples.wikipedia` ORDER BY timestamp

D. %%bq dryrun SELECT title, timestamp FROM `publicdata.samples.wikipedia` ORDER BY timestamp

When splitting a dataset into a training and an evaluation set, which would be a poor choice? A. 80% training, 20% evaluation B. 70% training, 30% evaluation C. 97% training, 3 % evaluation D. 3% training, 97% evaluation

D. 3% training, 97% evaluation

Convert 1001 from binary to decimal: A. 10.1 B. 17 C. 6 D. 9

D. 9

What does API stand for? A. Acquisition Program Integration B. After Project Initiation C. A Pleasing Interface D. Application Programming Interface

D. Application Programming Interface

Which of the following is the name of an important theorem about neural networks? A. Gradient Theorem B. Generalization Theorem C. Backpropagation Theorem D. Universality Theorem

D. Universality Theorem

What is the output? words = ['the', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog'] word_lengths = [len(word) for word in words if word != "the"] print(word_lengths) A. [29] B. [35] C. [3, 5, 5, 3, 5, 4, 3, 4, 3] D. [5, 5, 3, 5, 4, 4, 3]

D. [5, 5, 3, 5, 4, 4, 3]

HTML gives your webpage structure, but the appearance of your webpage may be defined by: A. a git command, specifically git page --appearance B. a .py file called a pysheet C. none of the above D. a .css file called a stylesheet

D. a .css file called a stylesheet

Which of the following shell commands would you use to find all of the lines containing the word molar in the winter data seasonal/winter.csv by running a single command from your home directory? A. cat molar seasonal/winter.csv B. touch molar seasonal/winter.csv C. echo molar seasonal/winter.csv D. grep molar seasonal/winter.csv

D. grep molar seasonal/winter.csv

Which command would you use to display the first 5 lines of the winter data seasonal/winter.csv in the seasonal directory? A. tail-n 5 seasonal/winter.csv B. head -n 5 seasonal/summer.csv C. cp -n 5 seasonal/winter.csv D. head -n 5 seasonal/winter.csv

D. head -n 5 seasonal/winter.csv

duplicates = [1, 2, 3, 1, 2, 5, 6, 7, 8] Which command will return a list consisting of the duplicates list without duplicates (without repeated numbers). A. duplicates.remove(duplicates) B. [duplicates.append(i) for i in duplicates if not i in duplicates] C. None of the above D. list(set(duplicates))

D. list(set(duplicates))

doctor = ['house', 'cuddy', 'chase', 'thirteen', 'wilson'] How would a list comprehension that produces a list of the first character of each string in doctor look like? The list comprehension is [for doc in doctor: doc[0]] and produces the list ['h', 'c', 'c', 't', 'w']. The list comprehension is [doc[0] for doc in doctor] and produces the list ['h', 'c', 'c', 't', 'w']. The list comprehension is [doc[0] in doctor] and produces the list ['h', 'c', 'c', 't', 'w'].

The list comprehension is [doc[0] for doc in doctor] and produces the list ['h', 'c', 'c', 't', 'w'].


Conjuntos de estudio relacionados

Finding Mean, Median, Mode and Range

View Set

SAUNDERS - INCORRECT Questions W/ Rationales Part 1

View Set

Cell bio lecture 14: Endomembrane System

View Set

Chapter 2 - Supply Chain Performance: Achieving Strategic Fit and Scope

View Set

Bill of Rights - First 10 Amendments of the Constitution

View Set

Study Guide - Unit 3 (English Civil War and Glorious Revolution)

View Set