
DataFrame Operations Quiz

Quiz
•
Computers
•
1st Grade
•
Hard
Adham Elmuntser
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a DataFrame from a dictionary?
pd.DataFrame(dict)
pd.DataFrame.from_dict()
pd.DataFrame(data)
pd.DataFrame.from_dict(data)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you read a CSV file into a DataFrame?
pd.read_csv('file.csv')
pd.read_file('file.csv')
pd.read('file.csv')
pd.DataFrame('file.csv')
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you display the first 5 rows of a DataFrame?
df.show(5)
df.head(5)
df.first(5)
df.top(5)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access a specific column in a DataFrame?
df.column('Age')
df.columns.Age
df['Age']
df.Age
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you filter rows based on a condition?
df.filter(df['Age'] >= 30)
df.loc[df['Age'] >= 30]
df[df['Age'] >= 30]
df.select(df['Age'] >= 30)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you add a new column to the DataFrame?
df.insert('Salary', [50000, 60000, 70000])
df['Salary'] = [50000, 60000, 70000]
df.set_column('Salary', [50000, 60000, 70000])
df.add_column('Salary', [50000, 60000, 70000])
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you rename a column in a DataFrame?
df.rename_column('Age', 'Years', inplace=True)
df.rename_column({'Age': 'Years'}, inplace=True)
df.rename(columns={'Age': 'Years'}, inplace=True)
df.rename({'Age': 'Years'}, inplace=True)
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
Data Types Python

Quiz
•
1st Grade
16 questions
Mikhail PS4 and doubles

Quiz
•
1st Grade
25 questions
QUIZ 2 ABRAHAM IPA (VISUAL BASIC)

Quiz
•
1st Grade
16 questions
tableau for fun

Quiz
•
1st Grade
20 questions
KOD ARAHAN HTML

Quiz
•
1st - 3rd Grade
20 questions
МашОб №26 Тест

Quiz
•
1st - 3rd Grade
18 questions
Nuclio : Project Renfe - ML

Quiz
•
1st - 5th Grade
20 questions
YUNIOR NETWORK ADMINISTRATOR

Quiz
•
1st Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade