Sử dụng Chương trình với Dữ liệu
Đã giới thiệu| English | Ý nghĩa |
|---|---|
| processing/ˈprəʊsesɪŋ/ | xử lý |
| iteration/ˌɪtəˈreɪʃn/ | lặp lại |
| element/ˈelɪmənt/ | phần tử |
| Cleaning/ˈkliːnɪŋ/ | Cleaning: làm sạch |
| filter/ˈfɪltə/ | bộ lọc |
| subset/ˈsʌbset/ | tập con |
| combine/kəmˈbaɪn/ | kết hợp |
| transform/trænsˈfɔːm/ | biến đổi |
Programs that answer questions
- The last step is to use a program to actually work with data.
- A program does this by processing 处理 — taking data in, doing steps, giving back new information.
- The input might be a list of records, like students and their test scores.
- The output might be a new fact the data never directly stated — like the class average.
Một chương trình nhận điểm vào và trả về điểm trung bình đang thực hiện:
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Đầu vào → xử lý → Đầu ra tạo ra một sự thật mới, đó là điểm trung bình.
Iteration visits every element
- To look at a whole data set, a program uses iteration 迭代 — repeating the same steps for each item.
- A loop visits each element 元素 (each item) of the list, one after another.
- So the program examines every record without a separate line for each one.
Average of five scores. A loop runs through $70, 85, 90, 60, 95$, adding each to a running total. After the loop the total is $400$; dividing by 5 gives the average $400 \div 5 = 80$ — information the raw list never stated.

Cleaning 清洗 data makes entries consistent before a program processes them
Theo dõi vòng lặp tổng điểm
Vòng lặp lặp qua danh sách, cộng từng điểm vào tổng lũy kế. Sau lượt cuối cùng tổng là 400; chia cho 5 cho ra trung bình là 80.
Lặp lại cùng các bước cho mỗi mục trong danh sách được gọi là ______.
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Một vòng lặp truy cập từng phần tử theo thứ tự.
Một vòng lặp cộng 70, 85, 90, 60, 95 để được 400. Trung bình của 5 điểm số là bao nhiêu?
Độ khó 2/5 · 140 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
400 ÷ 5 = 80.
Filtering to a subset
- Often we want only some records. A filter 过滤器 keeps records that meet a condition and drops the rest.
- A condition is a test that is true or false for each record, like "score is 80 or higher."
- The filter produces a smaller subset 子集 — only the records that pass.
- Worked idea. Filtering $70, 85, 90, 60, 95$ with "score $\geq 80$" keeps $85, 90, 95$ — 3 students.
Từ 70, 85, 90, 60, 95, có bao nhiêu điểm số vượt qua bộ lọc "điểm ≥ 80"?
Độ khó 2/5 · 140 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
85, 90, 95 vượt qua — một tập con gồm 3.
Nhóm nhỏ hơn các bản ghi vượt qua điều kiện của bộ lọc là một ______.
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Bộ lọc tạo ra một tập con từ các bản ghi gốc.
Tại sao phải làm sạch dữ liệu trước khi tính toán?
Độ khó 1/5 · 100 xu + một phần thưởng nhỏ cho lần hoàn thành đầu tiên trong ngày
Dữ liệu bẩn đưa ra kết quả sai, vì vậy hãy làm sạch trước để có kết quả đáng tin cậy.
Combine, transform, and clean
- A program can combine 合并 data from several sources — matching names to scores by a shared ID.
- Or transform 转换 it — converting Celsius to Fahrenheit, or raw scores to percentages.
- Cleaning inside the program (remove duplicates, skip blanks) keeps results reliable.
- Dirty data misleads: a duplicate skews the average, and a blank could crash the calculation.
A program processes data: input records in, new information out. Iteration visits every element to compute totals and averages; a filter keeps a subset meeting a condition. Programs also combine sources, transform values, and clean the data first — because dirty data gives a wrong answer.