Run2 stock data wrangling
Robust data cleaning and formatting for financial datasets in D3.js.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run2_stock-data-wranglingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.2 KB, 287 tokens by cl100k_base, as published. Nobody here has run it
Stock Data Wrangling
Ensuring data consistency between individual files and the summary CSV.
Robust ETF Detection
ETFs often have missing sector and marketCap. Explicitly label them to apply specific logic (uniform sizing, no tooltip).
const processed = rawData.map(d => {
const marketCap = d.marketCap ? parseFloat(d.marketCap) : null;
const isETF = isNaN(marketCap) || !marketCap || d.sector === "" || d.sector === "ETF";
return {
...d,
marketCap,
isETF,
sector: isETF ? "ETF" : d.sector
};
});
Precise Market Cap Formatting
Formatting numbers to "1.64T" or "150B" using fixed precision.
function formatCurrency(val) {
if (!val) return "N/A";
const trillion = 1e12;
const billion = 1e9;
const million = 1e6;
if (val >= trillion) return (val / trillion).toFixed(2) + "T";
if (val >= billion) return (val / billion).toFixed(2) + "B";
if (val >= million) return (val / million).toFixed(2) + "M";
return val.toLocaleString();
}
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.