{ "cells": [ { "cell_type": "markdown", "id": "6582e7ba", "metadata": {}, "source": [ "# Research Data DOIs — DataCite\n", "\n", "Starter notebook for the Kaggle dataset in this folder. It loads `datacite_dois.csv` with pandas and walks through quality checks and a first piece of analysis.\n", "\n", "**Files:** `datacite_dois.csv`, `data_dictionary.csv`." ] }, { "cell_type": "markdown", "id": "0000f7f2", "metadata": {}, "source": [ "## 1. Load the data" ] }, { "cell_type": "code", "id": "9c4bdb67", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.read_csv(\"datacite_dois.csv\", low_memory=False)\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": "14f05e49", "metadata": {}, "source": [ "## 4. Resource types" ] }, { "cell_type": "code", "id": "8e3cc256", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"resource_type_general\"].value_counts().head(12).to_frame(\"dois\")" ] }, { "cell_type": "markdown", "id": "67543863", "metadata": {}, "source": [ "## 5. Top repositories" ] }, { "cell_type": "code", "id": "1a4158e2", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"publisher\"].value_counts().head(15).to_frame(\"dois\")" ] }, { "cell_type": "markdown", "id": "05ff359b", "metadata": {}, "source": [ "## 6. Publication years" ] }, { "cell_type": "code", "id": "53520255", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"publication_year\"].value_counts().sort_index().tail(25).plot(kind=\"bar\", figsize=(11, 4))" ] }, { "cell_type": "markdown", "id": "0b3f4bab", "metadata": {}, "source": [ "## 7. Metadata coverage" ] }, { "cell_type": "code", "id": "52f8ad70", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "for c in [\"has_orcid\", \"has_funding\", \"has_geo\", \"has_rights\", \"has_related\"]:\n", " print(c, round((df[c].astype(str).str.lower() == \"true\").mean() * 100, 1), \"%\")" ] }, { "cell_type": "markdown", "id": "9abc6f33", "metadata": {}, "source": [ "## 8. Views vs downloads" ] }, { "cell_type": "code", "id": "77c9e13a", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "sub = df.dropna(subset=[\"view_count\", \"download_count\"])\n", "sub.plot.scatter(x=\"view_count\", y=\"download_count\", s=4, alpha=0.25, figsize=(8, 5))" ] }, { "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 }