Geavanceerd
Zoeken inSamenvattingen
Zo zoek je
  • Woorden vinden lestitels, tekst en code. Filter op soort (gidsen, cursussen, programma's, boeken) of blijf in dit boek.
  • book:rhcsa en ch:8 maken de zoektocht kleiner; #code vindt een woord alleen in commando's van de lessen.
  • "twee woorden" vindt precies die zin.
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken
Probeer:

Cursus 5Naam in de cursus: Python Project for Data Science

Python Project for Data Science

Course 5 of 12 in the IBM Data Science certificate. Build a small data project from start to finish with Python.

Course page: Coursera

  • 6 Lessen
  • 1 Commando's
  • 1 Labs

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

5.1

What the course covers

Build a small data project from start to finish with Python.

  • Collect stock data with web scraping and the yfinance library.
  • Read HTML tables with pandas and turn them into a DataFrame.
  • Use the short squeeze dashboard idea and show the key numbers.
  • Submit a notebook with code, charts, and a short written analysis.
ModuleMain focus
1. Crowdsourcing Short Squeeze DashboardWeb scraping, HTML, pandas tables, stock data, practice project
2. Final ProjectFinal submission, clean analysis, wrap up

5.2

Module 1: Crowdsourcing Short Squeeze Dashboard

Web scraping means getting data from web pages with code.

  • HTML uses tags. A table has <table>, <tr> for rows, and <td> for cells.
  • requests downloads the page. BeautifulSoup reads and searches the HTML.
  • pandas.read_html reads an HTML table from a page or a URL and gives a DataFrame.
  • yfinance is a Python library that gives stock price data.
  • Create a Ticker object, then call history() to get a price table.
  • A DataFrame is a table with rows and columns. Rows are records, columns are features.
  • Always check the data first: date range, missing values, and column types.
  • Plot price and volume to see the story in the data.
  • A short squeeze is a fast price jump when many short sellers must buy shares back.
  • Save the work in a notebook with clear markdown notes.

5.3

Module 2: Final Project

The final project asks you to extract stock data and show it in a simple dashboard.

  • A notebook has code cells and markdown cells. Use markdown to explain each step.
  • Build small parts: get the data, clean it, explore it, plot it, then write the summary.
  • A good chart has a title, labeled axes, and readable dates.
  • Explain what you see in plain words. Do not show code only.
  • Check the notebook output before you submit.

5.4

Check yourself

Answer each question first, then open it to check the answer.

1What is web scraping? a) Writing data to a database · b) Getting data from web pages with code · c) Deleting a web page · d) Drawing a chart

b) Getting data from web pages with code. Web scraping pulls data from web pages.

2Which library reads HTML tables directly into a DataFrame? a) NumPy · b) Flask · c) pandas · d) pytest

c) pandas. pandas has read_html for HTML tables.

3Which pandas call reads tables from a web page? a) pd.read_csv · b) pd.read_json · c) pd.read_sql · d) pd.read_html

d) pd.read_html. read_html returns a list of DataFrames.

4What does <tr> mean in HTML? a) A table row · b) A table column · c) A page title · d) A link

a) A table row. tr means table row. td means table cell.

5Which library does the course use to get stock prices? a) Django · b) yfinance · c) pytest · d) NumPy

b) yfinance. yfinance gives market data in Python.

6With yfinance, which object do you create first? a) A SQL cursor · b) An HTML parser · c) A Ticker object · d) A list of strings

c) A Ticker object. Make a Ticker, then ask for history.

7What is a DataFrame? a) A chart type · b) A web server · c) A Python file · d) A table with rows and columns

d) A table with rows and columns. A DataFrame is a two-dimensional table.

8What is a short squeeze? a) A fast price jump when short sellers must buy shares back · b) A slow fall in price over years · c) A database backup · d) A type of HTML tag

a) A fast price jump when short sellers must buy shares back. Short sellers buy back, and the price jumps up.

9Why use markdown cells in a notebook? a) To run the code · b) To explain the work in words · c) To store the data · d) To install packages

b) To explain the work in words. Markdown cells hold the explanation, not the code.

10You get a stock price table with dates. What should you check first? a) The color of the chart · b) The file name · c) The date range and missing values · d) The number of code cells

c) The date range and missing values. Check dates and gaps before any analysis.

11A good chart has: a) No labels · b) Many colors and no title · c) Only numbers · d) A title and labeled axes

d) A title and labeled axes. A chart needs a title and clear axis labels.

12What is the best order for the project work? a) Collect, clean, explore, plot, explain · b) Plot, then collect, then clean · c) Explain, then collect · d) Clean, then collect, then explain

a) Collect, clean, explore, plot, explain. Data comes first, then cleaning, then the story.

5.5

Study and exam tips

Do not mix read_csv, read_json, read_sql, and read_html. Each one reads a different source.

  • A DataFrame is a table. A chart is a picture. Keep these two words apart.
  • In HTML, tr is a row and td is a cell. Small letters matter.
  • The project order is always: collect, clean, explore, plot, explain.
  • Check dates and missing values before you trust any stock chart.

Commando's in deze les

Oefenen

Alle commando's in dit hoofdstuk