DS HW 3

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

c = 7 b = 7 c = c - 7 total = c - 7

-7

The table below shows the output of a classic dataset called the "Berkeley's 1973 Graduate Admissions Dataset": 0-12762 How many total rows are there in this dataset?

12763

Consider the following Python program: a = 7 y = 4 a = y - 1 answer = a + y + 1 What is stored in the variable a after the code above finishes running? Careful: The variable you're looking to find the value is not the last one to be assigned!

3

Year Major Gender Admission How many total columns of data are there in this dataset?

4

Year Major Gender Admission How many total variables are there in this dataset?

4

Which of the following assigns the variable y to be a DataFrame? A) y=pd.read_csv("https://waf.cs.illinois.edu/discovery/diamonds.csv") B) y = "language" C) y = -307

A

What statement best identifies the error in the Python code below? df = pd.read_csv("https://waf.cs.illinois.edu/discovery/party.csv") df

A) The pandas library is not imported. B) The code prints out pd but the dataset is stored in the variable df. C) The variable df only contains the URL of the dataset, not the loaded dataset. D) The command df.read_csv must be pd.read_csv. E) The URL is a string and requires quotes.

What statement best describes the following line of Python? import pandas as pd df = pd.read_csv('hello.csv')

A) Writes the contents of the DataFrame df into the file hello.csv. B) Reads the file hello.csv into the DataFrame named df. C) Creates a new file hello.csv in the DataFrame named df

Variable Types Which of the following assigns the variable x to be a number? A) x = pd.read_csv("https://waf.cs.illinois.edu/discovery/berkeley.csv") B) x = "land" C) x = -531

C

What statement best identifies the error in the Python code below? import pandas as pd df="https://waf.cs.illinois.edu/discovery/gpa.csv" df A) The command df.read_csv must be pd.read_csv. B) The code prints out pd but the dataset is stored in the variable df. C) The variable df only contains the URL of the dataset, not the loaded dataset. D) The URL is a string and requires quotes. E) The pandas library is not imported.

C

Write the Python code to load the file hello.csv (this file is already in the same directory) into a DataFrame.

import pandas as pd #Your Code Goes Here: df = pd.read_csv("hello.csv") df


Ensembles d'études connexes

WW1 Unit Test, WWI History Test Notes, Historical Concepts

View Set