
Ứng dụng Python phân tích dữ liệu và xây dựng mô hình_buổi 2

Quiz
•
Other
•
Professional Development
•
Medium
Văn Nhớ
Used 3+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong thư viện pandas của Python, hàm nào được sử dụng để đọc dữ liệu từ một file excel?
load_excel()
read_excel)
import_excel()
open_excel()
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để chọn các dòng của DataFrame "df" trong đó giá trị của cột "age" lớn hơn 18?
selected_rows = df[df["age"] > 18]
selected_rows = df.select_rows(df["age"] > 18)
selected_rows = df.filter(df["age"] > 18)
selected_rows = df.get_rows(df["age"] > 18)
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để tính tổng của cột "sales" trong DataFrame "df"?
total_sales = df.sum("sales")
total_sales = df.total("sales")
total_sales = df["sales"].sum()
total_sales = df.aggregate("sales", "sum")
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để chọn các dòng của DataFrame "df" trong đó giá trị của cột "category" là "A" hoặc "B"?
selected_rows = df[df["category"] == "A" or df["category"] == "B"]
selected_rows = df.select_rows(df["category"] == "A" or df["category"] == "B")
selected_rows = df[(df["category"] == "A") | (df["category"] == "B")]
selected_rows = df.filter(df["category"] == "A" or df["category"] == "B")
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để thêm một cột mới có tên là "discounted_price" với giá trị là giá trị của cột "price" trừ đi giảm giá "discount"?
df["discounted_price"] = df["price"] - df["discount"]
df["discounted_price"] = df.subtract("price", "discount")
df["discounted_price"] = df.calculate_discount("price", "discount")
df["discounted_price"] = df.apply_discount("price", "discount")
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để lấy ra các dòng của DataFrame "df" trong đó giá trị của cột "date" nằm trong khoảng từ "2022-01-01" đến "2022-01-15"?
selected_rows = df[(df["date"] >= "2022-01-01") and (df["date"] <= "2022-01-15")]
selected_rows = df[(df["date"] >= "2022-01-01") & (df["date"] <= "2022-01-15")]
selected_rows = df.filter(df["date"] >= "2022-01-01" and df["date"] <= "2022-01-15")
selected_rows = df.select_rows(df["date"] >= "2022-01-01" & df["date"] <= "2022-01-15")
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Trong pandas, làm thế nào để tính số lượng các dòng có giá trị duy nhất trong cột "category" của DataFrame "df"?
unique_count = df.unique("category")
unique_count = df["category"].unique_count()
unique_count = df["category"].nunique()
unique_count = df.count_unique("category")
8.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Câu lệnh nào dưới đây để thống kê giá trị tổng và trung bình của trường thu nhập (income) theo giới tính (gender) và trình độ học vấn (education) từ bàng dữ liệu df?
df.groupby(['gender', 'education']).['income'].agg(['sum', 'mean'])
df.groupby('gender', 'education').['income'].agg(['sum', 'mean'])
df.groupby(['gender', 'education']).['income'].agg('sum', 'mean')
df.groupby(['gender', 'education']).[income].agg(['sum', 'mean'])
Similar Resources on Wayground
10 questions
Oct 2024 Monthly Games - Day 2

Quiz
•
Professional Development
10 questions
Examen ATC CALL - Nº1 Setiembre

Quiz
•
Professional Development
12 questions
Risk Management On-boarding Quiz 2022

Quiz
•
Professional Development
10 questions
Post Test Kampus Zakat

Quiz
•
University - Professi...
12 questions
ASPAC QUIZ 14

Quiz
•
Professional Development
10 questions
API and Data Handling Quiz

Quiz
•
Professional Development
10 questions
Medication Order Shelf Life - Pre Test

Quiz
•
Professional Development
10 questions
Curso Informativo: Práctica DR

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Other
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
14 questions
2019 Logos

Quiz
•
Professional Development
6 questions
GUM Chart Scavenger Hunt

Quiz
•
Professional Development
8 questions
Understanding Government: Limited and Unlimited

Quiz
•
Professional Development
20 questions
tape measure

Quiz
•
Professional Development
24 questions
Street Signs

Quiz
•
9th Grade - Professio...