
Ứng dụng Python phân tích dữ liệu và xây dựng mô hình_buổi 2
Authored by Văn Nhớ
Other
Professional Development
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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"?
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")
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?