{ "cells": [ { "cell_type": "code", "execution_count": 3, "id": "b42faeb2", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.read_csv('data/distilbert-usa.csv', low_memory=False)\n", "\n", "df['Created At'] = pd.to_datetime(df['Created At'], errors='coerce')\n", "# remove rows where 'Created At' is NaT\n", "df = df.dropna(subset=['Created At'])\n", "\n", "df['Month_Year'] = df['Created At'].dt.strftime('%m/%Y')\n", "df.head()\n", "\n", "df.to_csv('data/distilbert-usa.csv', index=False)" ] }, { "cell_type": "code", "execution_count": null, "id": "829d418b", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" } }, "nbformat": 4, "nbformat_minor": 5 }