Coursera 笔记

Module 02 · Final Project期末项目

Final project overview期末项目概述

Coursera ↗

Estimated effort: 5 mins 预计用时:5 分钟

In this project, you will put all the skills acquired throughout the course and your knowledge of basic Python to test. You will work on real-world data and perform the operations of Extraction, Transformation, and Loading as required. Throughout the project, you will note some outputs you need to answer questions on the graded quiz. You will also take snapshots, which you will upload in the peer-graded assignment.
在此项目中,您将运用在整个课程中获得的所有技能以及您的 Python 基础知识。您将处理真实世界的数据,并根据要求执行提取、转换和加载操作。在整个项目中,您将记录一些输出,以便回答评分测验中的问题。您还将截取快照,并将其上传到同行评分作业中。

Project Scenario 项目场景

A multi-national firm has hired you as a data engineer. Your job is to access and process data as per requirements.
一家跨国公司聘请您担任数据工程师。您的工作是根据要求访问和处理数据。

Your boss asked you to compile the list of the top 10 largest banks in the world ranked by market capitalization in billion USD. Further, you need to transform the data and store it in USD, GBP, EUR, and INR per the exchange rate information made available to you as a CSV file. You should save the processed information table locally in a CSV format and as a database table. Managers from different countries will query the database table to extract the list and note the market capitalization value in their own currency.
您的老板要求您编制一份全球市值排名前 10 位的银行名单,市值以十亿美元计。此外,您需要根据以 CSV 文件形式提供的汇率信息,将数据转换为美元、英镑、欧元和印度卢比,并存储起来。您应该将处理后的信息表本地保存为 CSV 格式和数据库表。来自不同国家的经理将查询数据库表,以提取列表并记录其本国货币的市值。

Directions 方向

  1. Write a function to extract the tabular information from the given URL under the heading By Market Capitalization, and save it to a data frame.
    编写一个函数,从给定 URL 中“按市值”标题下提取表格信息,并将其保存到数据框中。
  2. Write a function to transform the data frame by adding columns for Market Capitalization in GBP, EUR, and INR, rounded to 2 decimal places, based on the exchange rate information shared as a CSV file.
    编写一个函数,根据以 CSV 文件形式共享的汇率信息,通过添加以英镑、欧元和印度卢比计的市值列(四舍五入到小数点后两位)来转换数据框。
  3. Write a function to load the transformed data frame to an output CSV file.
    编写一个函数,将转换后的数据框加载到输出 CSV 文件中。
  4. Write a function to load the transformed data frame to an SQL database server as a table.
    编写一个函数,将转换后的数据框作为表加载到 SQL 数据库服务器。
  5. Write a function to run queries on the database table.
    编写一个函数,用于对数据库表运行查询。
  6. Run the following queries on the database table:
    对数据库表运行以下查询:
    a. Extract the information for the London office, that is Name and MC_GBP_Billion
    a. 提取伦敦办事处的信息,即 Name 和 MC_GBP_Billion
    b. Extract the information for the Berlin office, that is Name and MC_EUR_Billion
    b. 提取柏林办事处的信息,即名称和 MC_EUR_Billion
    c. Extract the information for New Delhi office, that is Name and MC_INR_Billion
    c. 提取新德里办事处的信息,即名称和 MC_INR_Billion
  7. Write a function to log the progress of the code.
    编写一个函数来记录代码的进度。
  8. While executing the data initialization commands and function calls, maintain appropriate log entries.
    在执行数据初始化命令和函数调用时,维护适当的日志条目。