{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/tmp/ipykernel_751668/3571106454.py:2: DeprecationWarning: \n", "Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),\n", "(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)\n", "but was not found to be installed on your system.\n", "If this would cause problems for you,\n", "please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466\n", " \n", " import pandas as pd\n" ] } ], "source": [ "import os\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Europe\n", "input_filepath = \"../data/raw\"\n", "csv_files = os.listdir(f\"{input_filepath}/BM_csv_files/3000BC-AD500/\")\n", "europe_csv_files = [file for file in csv_files if \"africa\" in file.lower()]\n", "\n", "if europe_csv_files:\n", " # europe_csv_path = f\"{output_filepath}/BM_images/europe/\"\n", " # if not os.path.exists(europe_csv_path):\n", " # os.makedirs(europe_csv_path)\n", "\n", " europe_df = pd.DataFrame()\n", " for csv_file in europe_csv_files:\n", " csv_path = f\"{input_filepath}/BM_csv_files/3000BC-AD500/{csv_file}\"\n", " df = pd.read_csv(csv_path)\n", " europe_df = pd.concat([europe_df, df], ignore_index=True)\n", "\n", " # europe_df.drop_duplicates(inplace=True)\n", " # europe_df.to_csv(f\"{europe_csv_path}/europe.csv\", index=False)\n", " # print(\"Europe CSV file created successfully!\")\n", "else:\n", " print(\"No Europe CSV files found.\")" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "region = \"africa\"\n", "region_csv_files = [file for file in csv_files if region in file.lower()]\n", "region_df = pd.concat(\n", " [\n", " pd.read_csv(f\"{input_filepath}/BM_csv_files/3000BC-AD500/{file}\")\n", " for file in region_csv_files\n", " ]\n", ")\n", "region_df[\"Museum number\"] = region_df[\"Museum number\"].str.replace(r\"^No: \", \"\", regex=True)\n", "region_df.drop_duplicates(inplace=True)\n", "region_df = region_df[region_df[\"Museum number\"] != \"null\"]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Image | \n", "Object type | \n", "Museum number | \n", "Title | \n", "Denomination | \n", "Escapement | \n", "Description | \n", "Producer name | \n", "School/style | \n", "State | \n", "... | \n", "Acq date | \n", "Acq notes (acq) | \n", "Acq notes (exc) | \n", "Dept | \n", "BM/Big number | \n", "Reg number | \n", "Add ids | \n", "Cat no | \n", "Banknote serial number | \n", "Joined objects | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acorn lekythos | \n", "No: 1888,0601.716 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Attic red-figured pottery acorn lekythos, rest... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1888 | \n", "NaN | \n", "Excavated 1885-1886. | \n", "Greek and Roman | \n", "NaN | \n", "1888,0601.716 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
1 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acroterion | \n", "No: 1886,0401.45 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Fragment of a marble corner palmetto with bird... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.45 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
2 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acroterion | \n", "No: 1886,0401.1215 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Fragment of a marble acroterion palmetto. Two ... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.1215 | \n", "Miscellaneous number: 1886,0401.44 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
3 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "adze; hoe | \n", "No: null | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Iron adze or hoe. | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "Excavated 1885-1886 by Petrie. | \n", "External | \n", "NaN | \n", "NaN | \n", "Miscellaneous number: 1886.XI.5 (Publication p... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
4 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "aegis; votive offering | \n", "No: null | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Solid-cast fragmentary Menat-counterweight of ... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "Excavated 1884-1885. 1885: excavated by the Eg... | \n", "External | \n", "NaN | \n", "NaN | \n", "Miscellaneous number: 86.339 (Accession Number... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
44921 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "whetstone | \n", "No: null | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Whetstone. Well worn on both sides; dull beige. | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "External | \n", "NaN | \n", "NaN | \n", "Miscellaneous number: 2478 (Accession Number) | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
44922 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "whetstone | \n", "No: null | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Whetstone (?), made out of sandstone, in the s... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "Excavated 1884-1885. 1885: excavated by Willia... | \n", "External | \n", "NaN | \n", "NaN | \n", "Miscellaneous number: 86.185 (Accession Number... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
44923 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "whistle | \n", "No: EA22513 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "A terracotta whistle, still working, roughly i... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1885 | \n", "NaN | \n", "NaN | \n", "Egypt and Sudan | \n", "EA22513 | \n", "1885,0101.361 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
44924 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "whistle | \n", "No: 1906,0301.7 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Hand-modelled terracotta whistle, still workin... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1906 | \n", "NaN | \n", "Excavated May 1886. | \n", "Greek and Roman | \n", "NaN | \n", "1906,0301.7 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
44925 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "null; plate | \n", "No: null | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Body of North Ionian Late Wild Goat Style pott... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "External | \n", "NaN | \n", "NaN | \n", "Miscellaneous number: 26.2.35 (Accession Number) | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
44926 rows × 47 columns
\n", "\n", " | Image | \n", "Object type | \n", "Museum number | \n", "Title | \n", "Denomination | \n", "Escapement | \n", "Description | \n", "Producer name | \n", "School/style | \n", "State | \n", "... | \n", "Acq date | \n", "Acq notes (acq) | \n", "Acq notes (exc) | \n", "Dept | \n", "BM/Big number | \n", "Reg number | \n", "Add ids | \n", "Cat no | \n", "Banknote serial number | \n", "Joined objects | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acorn lekythos | \n", "1888,0601.716 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Attic red-figured pottery acorn lekythos, rest... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1888 | \n", "NaN | \n", "Excavated 1885-1886. | \n", "Greek and Roman | \n", "NaN | \n", "1888,0601.716 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
1 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acroterion | \n", "1886,0401.45 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Fragment of a marble corner palmetto with bird... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.45 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
2 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "acroterion | \n", "1886,0401.1215 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Fragment of a marble acroterion palmetto. Two ... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.1215 | \n", "Miscellaneous number: 1886,0401.44 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
7 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "alabastron | \n", "1894,1101.213 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Core-formed glass alabastron.\\r\\nOpaque orange... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1894 | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1894,1101.213 | \n", "Miscellaneous number: DBH.0056 (Harden number) | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
8 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "alabastron | \n", "132114 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Large baggy alabastron of horizontal banded, t... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1857 | \n", "NaN | \n", "NaN | \n", "Middle East | \n", "132114 | \n", "1857,1220.1 | \n", "Miscellaneous number: 416 (paper label attache... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
9301 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "vessel-fitting; lekane | \n", "1886,0401.1218 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Chian pottery plastic head, originally attache... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "Excavated 1884-1885. | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.1218 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
9302 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "vessel-fitting; lid | \n", "1886,0401.1429 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Plastic double head of Chian, probably black-f... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "Excavated 1884-1885. | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.1429 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
9304 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "volute krater | \n", "1924,1201.41 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Volute handle and rim sherd (consisting of 3 f... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1924,1201.41 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
9310 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "volute krater | \n", "1924,1201.40 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Sherd (mended from two fragments) of Laconian ... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1924,1201.40 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
9317 | \n", "https://media.britishmuseum.org/media/Reposito... | \n", "wall-painting | \n", "1886,0401.67 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "Stucco wall fragment, with marks of pointed to... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "... | \n", "1886 | \n", "NaN | \n", "NaN | \n", "Greek and Roman | \n", "NaN | \n", "1886,0401.67 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
19570 rows × 47 columns
\n", "