Skip to content

About

JKU class Advanced Interactive Visualization. Project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Advanced Interactive Visualization

Do the things the news talks about move the things the market prices?

This project joins four years of New York Times article metadata to daily prices for 20+ assets — equities, commodities and crypto — over June 2019 → June 2023, and builds an interactive view for exploring whether coverage and price movement line up.

▶ Final visualisation: https://observablehq.com/d/eac52a8d2fa130d8

The word cloud there is clickable: selecting a keyword filters the price series, so you can see what the market did around the dates a term spiked in coverage.

Coursework for Advanced Interactive Visualization, JKU Linz.

Method

  1. Load and window. NYT metadata (nyt-metadata.csv) and a stock-market dataset are each parsed to real dates and clipped to 2019-06-01 → 2023-06-01.
  2. Outer-join on date. Keeping all dates from both sides rather than only their intersection — a day with news but no trading (weekends, holidays) still exists in the timeline.
  3. Forward-fill prices. Markets close; news does not. Price and volume columns are forward-filled across non-trading days so every article sits against the last known price. Text columns get empty strings rather than NaN.
  4. Extract keywords. Article keywords and abstracts are tokenised, filtered against sklearn's English stop-word list, and counted per month.
  5. Publish. Aggregates are exported for Observable and Power BI.

Assets covered include Natural Gas, Crude Oil, Copper, Platinum, Silver, Gold, Bitcoin, Ethereum, S&P 500, Nasdaq 100, Apple, Tesla, Microsoft, Google, Nvidia, Berkshire, Netflix, Amazon and Meta.

Layout

Path Contents
VisualAnalytics.ipynb The full pipeline — load, window, merge, clean, aggregate, export (52 cells)
feb_last_ultraclean_v2_final.csv Cleaned keyword frequencies, February (word,count, 564 terms)
march_last_ultraclean.csv Cleaned keyword frequencies, March (word,count, 512 terms)
Links.txt Link to the published Observable notebook

Running the notebook

pip install pandas matplotlib numpy wordcloud scikit-learn dash plotly
jupyter notebook VisualAnalytics.ipynb

Source data

The two input datasets are not committed — nyt-metadata.csv in particular is far past GitHub's file limit. The merged dataset is available here:

https://drive.google.com/file/d/1VD45Cian1Lbf8_tuqWn2vaeYu0K-Gy1y/view?usp=sharing

Place nyt-metadata.csv and Stock_Market _Dataset _2.csv next to the notebook to re-run from scratch. Only the derived keyword CSVs are in the repository.

Notes

  • The cell order matters — merged is assigned partway through and a couple of earlier cells reference it before that point. Run top to bottom.
  • The Observable notebook is the finished artefact; the Python here is the preparation pipeline behind it.

About

JKU class Advanced Interactive Visualization. Project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages