Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Mining - 04

Total questions: 6

Worksheet time: 6mins

Name
Class
Date
1.

In our last meeting, what are the key things you learned about Python, Pandas, or NumPy? Also, which parts did you find most difficult or confusing,

4 lines
2.

What is the purpose of the line import pandas as pd?

a)

To rename the Python interpreter

b)

To import the pandas library with an alias

c)

To install pandas in the code

d)

To import pandas and NumPy together

3.

In the code, what does df = pd.DataFrame(data) do?

a)

It deletes the dictionary named data

b)

It converts data into a DataFrame object

c)

It renames the dictionary data into df

d)

It creates a NumPy array from data

4.

What will the variable fruit_count store?

a)

The number of unique categories in the DataFrame

b)

The total number of rows in the DataFrame

c)

The count of rows where the category is 'Fruit'

d)

The price sum of all 'Fruit' items

5.

Which of the following best represents the output of the code?

a)

Number of rows with 'Fruit' category: 1

b)

Number of rows with 'Fruit' category: 2

c)

Number of rows with 'Fruit' category: 3

d)

Number of rows with 'Fruit' category: 4

6.

If we want to calculate the average Price of all items, which Pandas function is most appropriate?

a)

df['Price'].mean()

b)

df['Price'].sum()

c)

df['Price'].count()

d)

df['Price'].min()