Search Header Logo

Python Pandas/MatPlotLib

Authored by Brian Akwirry

Computers

12th Grade

Used 16+ times

Python Pandas/MatPlotLib
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What does df.groupby('column_name').mean() do in Pandas?

Groups the DataFrame by 'column_name' and calculates the mean of all columns

Finds the mean value of 'column_name'

Splits the DataFrame into groups based on 'column_name' and calculates the mean of each group

Sorts 'column_name' in ascending order

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

In Pandas, how do you select the rows where the column 'age' is greater than 25?

df[df['age'] > 25]

df.select('age' > 25)

df.query('age' > 25)

df['age'].select(> 25)

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

How would you save a plot as a PNG file in Matplotlib?

plt.savefig('plot.png')

plt.save('plot.png')

plt.export('plot.png')

plt.write('plot.png')

4.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

In Pandas, what does df.isnull().sum() return?

The sum of all values in the DataFrame

The total number of missing values in each column

A boolean value indicating if there are any null values

The sum of non-null values in the DataFrame

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which method is used to read a CSV file into a Pandas DataFrame?

pd.read_csv('file.csv')

pd.csv('file.csv')

pd.readfile('file.csv')

pd.open_csv('file.csv')

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

In Matplotlib, how do you set the title of a plot?

plt.title('My Title')

plt.set_title('My Title')

plt.name('My Title')

plt.label('My Title')

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

How can you create a new column in a DataFrame in Pandas?

df['new_column'] = value

df.add('new_column', value)

df.new_column(value)

df.insert('new_column', value)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?