wikisource-crawler/notebooks/join.ipynb

96 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2023-01-07 15:21:57 +01:00
{
"cells": [
{
"cell_type": "code",
2023-01-10 19:05:56 +01:00
"execution_count": null,
2023-01-07 15:21:57 +01:00
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
2023-01-10 19:05:56 +01:00
"execution_count": null,
2023-01-07 15:21:57 +01:00
"metadata": {},
"outputs": [],
"source": [
2023-01-10 19:05:56 +01:00
"green = pd.read_csv(\"../../wikisource-data/green.tsv\", sep=\"\\t\")\n"
2023-01-07 15:21:57 +01:00
]
},
{
"cell_type": "code",
2023-01-10 19:05:56 +01:00
"execution_count": null,
2023-01-07 15:21:57 +01:00
"metadata": {},
"outputs": [],
"source": [
2023-01-10 19:05:56 +01:00
"green.tail()"
2023-01-07 15:21:57 +01:00
]
},
{
"cell_type": "code",
2023-01-10 19:05:56 +01:00
"execution_count": null,
2023-01-07 15:21:57 +01:00
"metadata": {},
"outputs": [],
"source": [
2023-01-10 19:05:56 +01:00
"green = pd.read_csv(\"../green-full.tsv\", sep=\"\\t\")\n",
"yellow = pd.read_csv(\"../yellow-full.tsv\", sep=\"\\t\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"whole = pd.concat([green, yellow], axis=0)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"len(whole)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"whole.to_csv(\"./wikisource-full.tsv\", sep=\"\\t\")"
2023-01-07 15:21:57 +01:00
]
}
],
"metadata": {
"kernelspec": {
"display_name": "um",
"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.9.15"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "876e189cbbe99a9a838ece62aae1013186c4bb7e0254a10cfa2f9b2381853efb"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}