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

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

Professional Development

8 Qs

quiz-placeholder

Similar activities

DIS EOY Data 2024

DIS EOY Data 2024

Professional Development

7 Qs

Интранет

Интранет

Professional Development

10 Qs

FinTech 03-2 Pandas

FinTech 03-2 Pandas

Professional Development

10 Qs

Trabert y Diadinamicas

Trabert y Diadinamicas

Professional Development

10 Qs

LPE Trivia

LPE Trivia

Professional Development

12 Qs

FAZZIO

FAZZIO

Professional Development

10 Qs

IHT Exam Revision - Chap 1 (V1)

IHT Exam Revision - Chap 1 (V1)

Professional Development

11 Qs

latihan soal

latihan soal

Professional Development

7 Qs

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

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

Assessment

Quiz

Other

Professional Development

Medium

Created by

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

  1. 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'])