Skip to main content
etl/pageviews_clean.py · chapter Building a row, file 4 · 59 lines · open in the repository

What it does

Clean the raw page view files and save clean/pageviews.parquet. Run from anywhere: python3 etl/pageviews_clean.py Output: the pageviews contract (article, ticker, date, views), one row per in-scope retailer per day of the study period. Renamed articles: some tickers have two titles in config/wiki_articles.csv (e.g. Amazon.com became Amazon_(company) in Sept 2017; The_Home_Depot became Home_Depot in May 2024). Their views are added together per ticker and day, and article is the title used most in the latest year (the current name).

Connections

Uses: src/common/contracts.py, src/common/settings.py, src/common/study.py

Source

etl/pageviews_clean.py