{ "cells": [ { "cell_type": "markdown", "id": "c6a77f1f", "metadata": {}, "source": [ "# Most-Cited Scholarly Works\n", "\n", "Starter notebook for the Kaggle dataset in this folder. It loads `crossref_works.csv` with pandas and walks through quality checks and a first piece of analysis.\n", "\n", "**Files:** `crossref_works.csv`, `data_dictionary.csv`." ] }, { "cell_type": "markdown", "id": "0000f7f2", "metadata": {}, "source": [ "## 1. Load the data" ] }, { "cell_type": "code", "id": "9705b38c", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "\n", "df = pd.read_csv(\"crossref_works.csv\")\n", "df[\"published_year\"] = pd.to_numeric(df[\"published_year\"], errors=\"coerce\")\n", "df[\"citations\"] = pd.to_numeric(df[\"citations\"], errors=\"coerce\")\n", "print(df.shape)" ] }, { "cell_type": "markdown", "id": "325de123", "metadata": {}, "source": [ "## 2. Shape, types and missing values" ] }, { "cell_type": "code", "id": "6eb42bc8", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "print(f\"{df.shape[0]:,} rows x {df.shape[1]} columns\")\n", "\n", "missing = df.isna().mean().mul(100).sort_values(ascending=False)\n", "missing[missing > 0].round(1).to_frame(\"missing_%\").head(15)" ] }, { "cell_type": "markdown", "id": "f2d963fe", "metadata": {}, "source": [ "## 3. Numeric summary" ] }, { "cell_type": "code", "id": "aa2f8fd4", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df.describe(include='number').T.round(2).head(20)" ] }, { "cell_type": "markdown", "id": "b3fe651f", "metadata": {}, "source": [ "## 4. Citation distribution\n", "\n", "Citations are extremely heavy-tailed — plot on a log scale." ] }, { "cell_type": "code", "id": "dd105e99", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"citations\"].dropna().clip(lower=1).plot.hist(bins=60, log=True, figsize=(9, 5))" ] }, { "cell_type": "markdown", "id": "65405f34", "metadata": {}, "source": [ "## 5. Open access vs citations\n", "\n", "Compare the citation distribution for works with and without a registered licence." ] }, { "cell_type": "code", "id": "7500edd5", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df.groupby(\"is_open_access\")[\"citations\"].describe().round(1)" ] }, { "cell_type": "markdown", "id": "df4d8f8e", "metadata": {}, "source": [ "## 6. Team size and impact" ] }, { "cell_type": "code", "id": "ecd7fdb6", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "(df.groupby(\"team_size_class\")[\"citations\"]\n", " .agg([\"count\", \"median\", \"mean\"]).round(1)\n", " .sort_values(\"median\", ascending=False))" ] }, { "cell_type": "markdown", "id": "f6d684bc", "metadata": {}, "source": [ "## 7. Leading journals by mean citations" ] }, { "cell_type": "code", "id": "55b76edb", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "top = (df.groupby(\"journal\")\n", " .agg(articles=(\"doi\", \"count\"), median_citations=(\"citations\", \"median\"))\n", " .query(\"articles >= 20\")\n", " .sort_values(\"median_citations\", ascending=False).head(15))\n", "top" ] }, { "cell_type": "markdown", "id": "44a2c1e0", "metadata": {}, "source": [ "## 8. Field mix over time" ] }, { "cell_type": "code", "id": "34aa9829", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "(df.dropna(subset=[\"field\", \"published_year\"])\n", " .groupby([\"published_year\", \"field\"]).size()\n", " .unstack(fill_value=0).plot.area(figsize=(12, 6), cmap=\"tab20\"))" ] }, { "cell_type": "markdown", "id": "6e43770c", "metadata": {}, "source": [ "## Next steps\n", "\n", "See `KAGGLE.md` for analysis ideas, caveats and provenance." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.11", "mimetype": "text/x-python", "file_extension": ".py", "codemirror_mode": { "name": "ipython", "version": 3 }, "pygments_lexer": "ipython3", "nbconvert_exporter": "python" } }, "nbformat": 4, "nbformat_minor": 5 }