2024-02-20 02:03:23 +01:00
{
"cells": [
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 335,
2024-02-20 02:03:23 +01:00
"id": "482d19ab-5dd1-4e75-b2c1-df734ce5ee66",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np"
]
},
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 336,
2024-02-20 02:03:23 +01:00
"id": "b1b5a536-b76c-427b-ab6b-f0235c84f5ad",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import s3fs\n",
"# Create filesystem object\n",
"S3_ENDPOINT_URL = \"https://\" + os.environ[\"AWS_S3_ENDPOINT\"]\n",
"fs = s3fs.S3FileSystem(client_kwargs={'endpoint_url': S3_ENDPOINT_URL})\n"
]
},
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 337,
2024-02-20 02:03:23 +01:00
"id": "0469164d-5770-443e-8cf4-d4f1ebd1b853",
"metadata": {},
"outputs": [],
"source": [
"entreprise_base=['bdc2324-data/1', 'bdc2324-data/2', 'bdc2324-data/3', 'bdc2324-data/4', 'bdc2324-data/5', 'bdc2324-data/6', 'bdc2324-data/7', 'bdc2324-data/8','bdc2324-data/9','bdc2324-data/10','bdc2324-data/11','bdc2324-data/12','bdc2324-data/13','bdc2324-data/14','bdc2324-data/101']"
]
},
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 343,
2024-02-20 02:03:23 +01:00
"id": "55fbbad2-537e-4098-9a2d-d3850fab7332",
"metadata": {},
"outputs": [
{
2024-02-20 02:27:30 +01:00
"ename": "PermissionError",
"evalue": "The Access Key Id you provided does not exist in our records.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mClientError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:394\u001b[0m, in \u001b[0;36mS3FileSystem._lsdir\u001b[0;34m(self, path, refresh, max_items)\u001b[0m\n\u001b[1;32m 393\u001b[0m dircache \u001b[38;5;241m=\u001b[39m []\n\u001b[0;32m--> 394\u001b[0m \u001b[43m\u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mi\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mit\u001b[49m\u001b[43m:\u001b[49m\n\u001b[1;32m 395\u001b[0m \u001b[43m \u001b[49m\u001b[43mdircache\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mextend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mi\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mCommonPrefixes\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/paginate.py:269\u001b[0m, in \u001b[0;36mPageIterator.__iter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 268\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 269\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcurrent_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 270\u001b[0m parsed \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_extract_parsed_response(response)\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/paginate.py:357\u001b[0m, in \u001b[0;36mPageIterator._make_request\u001b[0;34m(self, current_kwargs)\u001b[0m\n\u001b[1;32m 356\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_make_request\u001b[39m(\u001b[38;5;28mself\u001b[39m, current_kwargs):\n\u001b[0;32m--> 357\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_method\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcurrent_kwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/client.py:553\u001b[0m, in \u001b[0;36mClientCreator._create_api_method.<locals>._api_call\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 552\u001b[0m \u001b[38;5;66;03m# The \"self\" in this scope is referring to the BaseClient.\u001b[39;00m\n\u001b[0;32m--> 553\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_api_call\u001b[49m\u001b[43m(\u001b[49m\u001b[43moperation_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/client.py:1009\u001b[0m, in \u001b[0;36mBaseClient._make_api_call\u001b[0;34m(self, operation_name, api_params)\u001b[0m\n\u001b[1;32m 1008\u001b[0m error_class \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mfrom_code(error_code)\n\u001b[0;32m-> 1009\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m error_class(parsed_response, operation_name)\n\u001b[1;32m 1010\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"\u001b[0;31mClientError\u001b[0m: An error occurred (InvalidAccessKeyId) when calling the ListObjectsV2 operation: The Access Key Id you provided does not exist in our records.",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mPermissionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[343], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m BUCKET \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbdc2324-data/2\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mls\u001b[49m\u001b[43m(\u001b[49m\u001b[43mBUCKET\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:619\u001b[0m, in \u001b[0;36mS3FileSystem.ls\u001b[0;34m(self, path, detail, refresh, **kwargs)\u001b[0m\n\u001b[1;32m 604\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\" List single \"directory\" with or without details\u001b[39;00m\n\u001b[1;32m 605\u001b[0m \n\u001b[1;32m 606\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 616\u001b[0m \u001b[38;5;124;03m additional arguments passed on\u001b[39;00m\n\u001b[1;32m 617\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 618\u001b[0m path \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_strip_protocol(path)\u001b[38;5;241m.\u001b[39mrstrip(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 619\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_ls\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrefresh\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefresh\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 620\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m files:\n\u001b[1;32m 621\u001b[0m files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_ls(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parent(path), refresh\u001b[38;5;241m=\u001b[39mrefresh)\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:487\u001b[0m, in \u001b[0;36mS3FileSystem._ls\u001b[0;34m(self, path, refresh)\u001b[0m\n\u001b[1;32m 485\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lsbuckets(refresh)\n\u001b[1;32m 486\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 487\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_lsdir\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrefresh\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:409\u001b[0m, in \u001b[0;36mS3FileSystem._lsdir\u001b[0;34m(self, path, refresh, max_items)\u001b[0m\n\u001b[1;32m 407\u001b[0m f[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m f[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mKey\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m ClientError \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 409\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m translate_boto_error(e)\n\u001b[1;32m 411\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdircache[path] \u001b[38;5;241m=\u001b[39m files\n\u001b[1;32m 412\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m files\n",
"\u001b[0;31mPermissionError\u001b[0m: The Access Key Id you provided does not exist in our records."
]
2024-02-20 02:03:23 +01:00
}
],
"source": [
2024-02-20 02:27:30 +01:00
"BUCKET = \"bdc2324-data/2\"\n",
2024-02-20 02:03:23 +01:00
"fs.ls(BUCKET)"
]
},
{
"cell_type": "code",
"execution_count": 281,
"id": "0b76f171-9ae1-4900-a23e-ec4dd57d461a",
"metadata": {},
"outputs": [],
"source": [
"pd.reset_option('display.max_rows')\n"
]
},
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 341,
2024-02-20 02:03:23 +01:00
"id": "85357844-15f6-4098-9032-18310305c332",
"metadata": {},
2024-02-20 02:27:30 +01:00
"outputs": [
{
"ename": "PermissionError",
"evalue": "Forbidden",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mClientError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:529\u001b[0m, in \u001b[0;36mS3FileSystem.info\u001b[0;34m(self, path, version_id, refresh)\u001b[0m\n\u001b[1;32m 528\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 529\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_call_s3\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43ms3\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mhead_object\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mBucket\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbucket\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 530\u001b[0m \u001b[43m \u001b[49m\u001b[43mKey\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mversion_id_kw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mversion_id\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreq_kw\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 531\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 532\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mETag\u001b[39m\u001b[38;5;124m'\u001b[39m: out[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mETag\u001b[39m\u001b[38;5;124m'\u001b[39m],\n\u001b[1;32m 533\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mKey\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin([bucket, key]),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 540\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mVersionId\u001b[39m\u001b[38;5;124m'\u001b[39m: out\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mVersionId\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 541\u001b[0m }\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:200\u001b[0m, in \u001b[0;36mS3FileSystem._call_s3\u001b[0;34m(self, method, *akwarglist, **kwargs)\u001b[0m\n\u001b[1;32m 198\u001b[0m additional_kwargs \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_s3_method_kwargs(method, \u001b[38;5;241m*\u001b[39makwarglist,\n\u001b[1;32m 199\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 200\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmethod\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43madditional_kwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/client.py:553\u001b[0m, in \u001b[0;36mClientCreator._create_api_method.<locals>._api_call\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 552\u001b[0m \u001b[38;5;66;03m# The \"self\" in this scope is referring to the BaseClient.\u001b[39;00m\n\u001b[0;32m--> 553\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_api_call\u001b[49m\u001b[43m(\u001b[49m\u001b[43moperation_name\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/botocore/client.py:1009\u001b[0m, in \u001b[0;36mBaseClient._make_api_call\u001b[0;34m(self, operation_name, api_params)\u001b[0m\n\u001b[1;32m 1008\u001b[0m error_class \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexceptions\u001b[38;5;241m.\u001b[39mfrom_code(error_code)\n\u001b[0;32m-> 1009\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m error_class(parsed_response, operation_name)\n\u001b[1;32m 1010\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"\u001b[0;31mClientError\u001b[0m: An error occurred (403) when calling the HeadObject operation: Forbidden",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mPermissionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[341], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m entreprise \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbdc2324-data/2/2\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mevents\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m.csv\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43mentreprise\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrb\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m file_in:\n\u001b[1;32m 3\u001b[0m df_event\u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mread_csv(file_in, sep\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/fsspec/spec.py:1295\u001b[0m, in \u001b[0;36mAbstractFileSystem.open\u001b[0;34m(self, path, mode, block_size, cache_options, compression, **kwargs)\u001b[0m\n\u001b[1;32m 1293\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1294\u001b[0m ac \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mautocommit\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_intrans)\n\u001b[0;32m-> 1295\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_open\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1296\u001b[0m \u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1297\u001b[0m \u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1298\u001b[0m \u001b[43m \u001b[49m\u001b[43mblock_size\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mblock_size\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1299\u001b[0m \u001b[43m \u001b[49m\u001b[43mautocommit\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mac\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1300\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1301\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1302\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1303\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m compression \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1304\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mfsspec\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcompression\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m compr\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:375\u001b[0m, in \u001b[0;36mS3FileSystem._open\u001b[0;34m(self, path, mode, block_size, acl, version_id, fill_cache, cache_type, autocommit, requester_pays, **kwargs)\u001b[0m\n\u001b[1;32m 372\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cache_type \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 373\u001b[0m cache_type \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdefault_cache_type\n\u001b[0;32m--> 375\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mS3File\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock_size\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mblock_size\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43macl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43macl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 376\u001b[0m \u001b[43m \u001b[49m\u001b[43mversion_id\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mversion_id\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfill_cache\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfill_cache\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 377\u001b[0m \u001b[43m \u001b[49m\u001b[43ms3_additional_kwargs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkw\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcache_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 378\u001b[0m \u001b[43m \u001b[49m\u001b[43mautocommit\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mautocommit\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrequester_pays\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequester_pays\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:1096\u001b[0m, in \u001b[0;36mS3File.__init__\u001b[0;34m(self, s3, path, mode, block_size, acl, version_id, fill_cache, s3_additional_kwargs, autocommit, cache_type, requester_pays)\u001b[0m\n\u001b[1;32m 1094\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39ms3_additional_kwargs \u001b[38;5;241m=\u001b[39m s3_additional_kwargs \u001b[38;5;129;01mor\u001b[39;00m {}\n\u001b[1;32m 1095\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreq_kw \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mRequestPayer\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mrequester\u001b[39m\u001b[38;5;124m'\u001b[39m} \u001b[38;5;28;01mif\u001b[39;00m requester_pays \u001b[38;5;28;01melse\u001b[39;00m {}\n\u001b[0;32m-> 1096\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43ms3\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mblock_size\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mautocommit\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mautocommit\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1097\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_type\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1098\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39ms3 \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfs \u001b[38;5;66;03m# compatibility\u001b[39;00m\n\u001b[1;32m 1099\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mwritable():\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/fsspec/spec.py:1651\u001b[0m, in \u001b[0;36mAbstractBufferedFile.__init__\u001b[0;34m(self, fs, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs)\u001b[0m\n\u001b[1;32m 1649\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m=\u001b[39m size\n\u001b[1;32m 1650\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1651\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdetails\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msize\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 1652\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcache \u001b[38;5;241m=\u001b[39m caches[cache_type](\n\u001b[1;32m 1653\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mblocksize, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_fetch_range, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msize, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mcache_options\n\u001b[1;32m 1654\u001b[0m )\n\u001b[1;32m 1655\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/fsspec/spec.py:1664\u001b[0m, in \u001b[0;36mAbstractBufferedFile.details\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1661\u001b[0m \u001b[38;5;129m@property\u001b[39m\n\u001b[1;32m 1662\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdetails\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 1663\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_details \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m-> 1664\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_details \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minfo\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1665\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_details\n",
"File \u001b[0;32m/opt/mamba/lib/python3.11/site-packages/s3fs/core.py:548\u001b[0m, in \u001b[0;36mS3FileSystem.info\u001b[0;34m(self, path, version_id, refresh)\u001b[0m\n\u001b[1;32m 546\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m(S3FileSystem, \u001b[38;5;28mself\u001b[39m)\u001b[38;5;241m.\u001b[39minfo(path)\n\u001b[1;32m 547\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 548\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ee\n\u001b[1;32m 549\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m ParamValidationError \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 550\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mFailed to head path \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m \u001b[38;5;241m%\u001b[39m (path, e))\n",
"\u001b[0;31mPermissionError\u001b[0m: Forbidden"
]
}
],
2024-02-20 02:03:23 +01:00
"source": [
"entreprise = 'bdc2324-data/2/2' + 'events' + '.csv'\n",
"with fs.open(entreprise, mode=\"rb\") as file_in:\n",
" df_event= pd.read_csv(file_in, sep=\",\")"
]
},
{
"cell_type": "code",
2024-02-20 02:27:30 +01:00
"execution_count": 342,
2024-02-20 02:03:23 +01:00
"id": "e6117d69-9916-4a81-88aa-0340c6af13e1",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>created_at</th>\n",
" <th>updated_at</th>\n",
" <th>season_id</th>\n",
" <th>facility_id</th>\n",
" <th>name</th>\n",
" <th>event_type_id</th>\n",
" <th>manual_added</th>\n",
" <th>is_display</th>\n",
" <th>event_type_key_id</th>\n",
" <th>facility_key_id</th>\n",
" <th>identifier</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>15</td>\n",
" <td>2023-10-13 13:02:09.517079+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>„kreativ mit allen sinnen\"</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>08f32b3fd76fcbfcb949502f4a78b052</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>11</td>\n",
" <td>2023-10-13 13:02:09.515135+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>truffes zauber</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0eafeafe7396fea2284da359febb069d</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>12</td>\n",
" <td>2023-10-13 13:02:09.515619+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-schule li – die führung für oberstufen &...</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>235c4d3206c90b61f668e0e8051cdf33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>14</td>\n",
" <td>2023-10-13 13:02:09.516604+02:00</td>\n",
" <td>2023-11-03 10:17:05.663186+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>„formen & veredeln\"</td>\n",
" <td>44</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>ed3d806039d13f9a7999033ef68ebe81</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>10</td>\n",
" <td>2023-10-13 13:02:09.514640+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>truffes zauber</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1d4c8761a169128962464ec99ba135f8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>18</td>\n",
" <td>2023-10-13 13:02:09.518522+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-welt – die öffentliche führung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>e4e2915fd5ba2a5d14fb51d8df063bed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>17</td>\n",
" <td>2023-10-13 13:02:09.518037+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>schokoladentour – familien</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>5bf172dd5a3bf11f2b346eee5588c97a</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>41</td>\n",
" <td>2023-10-13 13:07:51.131668+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>ausfahrtsticket</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>04fe59a3f6db96a83f6c9734905acb7e</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>3</td>\n",
" <td>2023-10-13 13:02:09.510741+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-welt – gruppenführung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>8cf7a143170249b3286c2b76b9580f4b</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>1</td>\n",
" <td>2023-10-13 13:02:09.443323+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>schokoladentour – einzelticket</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>34c2ab5c6c6750f78d6e475023db1dcb</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>9</td>\n",
" <td>2023-10-13 13:02:09.514157+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>„formen & veredeln\"</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>40d0622668130a47c06aa63742cc1c55</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>7</td>\n",
" <td>2023-10-13 13:02:09.513141+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>choco-deluxe – die öffentliche führung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>af69a8da972bb9975f78748655a6bdad</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>451</td>\n",
" <td>2023-10-13 15:49:57.226957+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>weihnachts-special</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>e48ae983e2654f7dd1055f0ed25b4155</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>6</td>\n",
" <td>2023-10-13 13:02:09.512552+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>gutschein schokoladentour</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>662a3e0d8e88a64afb792d6aecc20395</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>4</td>\n",
" <td>2023-10-13 13:02:09.511362+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-deluxe – die öffentliche führung (de)</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>98e165773ac25e1ef8ef84ccc8c45eb4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>5</td>\n",
" <td>2023-10-13 13:02:09.511954+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>„kreativ mit allen sinnen\"</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>8180dfe4fc995269bfac5336c13ec931</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>453</td>\n",
" <td>2023-10-13 15:49:57.238792+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>privater chocolateria workshop</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>7cc2c03196cdc8adfc4102c87f15056e</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>759</td>\n",
" <td>2023-10-31 03:20:00.509720+01:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-schule i – die führung für primarschulkl...</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>582a63d22864911766d8e019c277d1b3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>24</td>\n",
" <td>2023-10-13 13:02:09.521575+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>choco-welt – die gruppenführung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>9fa748c7defa0d4f6976faa875d8c394</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>21</td>\n",
" <td>2023-10-13 13:02:09.520019+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>chocolateria</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>169b7c348566ccfd0e6ccdeeb6ac5f5a</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>40</td>\n",
" <td>2023-10-13 13:07:51.131049+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>verlängerungspauschale führungen</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>d22a3ae3c0712be5dfe9858b97a22034</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>2</td>\n",
" <td>2023-10-13 13:02:09.509959+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-deluxe – die öffentliche führung (en)</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>84d0ef8ed664798bfa6a0d297f45bf2d</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>22</td>\n",
" <td>2023-10-13 13:02:09.520492+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>weihnacht-special</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>634f074cc18efa0e0ce88bdec14f248e</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>20</td>\n",
" <td>2023-10-13 13:02:09.519518+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>gutschein gruppentarife</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>f005c784b0a8db8244177e61e774a9b6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>13</td>\n",
" <td>2023-10-13 13:02:09.516105+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-deluxe – die exklusive gruppenführung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>acb6ff9ac2bac1c55043bcb67a72a3a0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>103</td>\n",
" <td>2023-10-13 13:24:59.980586+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-schule l – die führung für primarschulkl...</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>7b44ae19449523c65c1140c8aa4db924</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>81</td>\n",
" <td>2023-10-13 13:19:30.509755+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>jumper-deluxe (de) – die weihnachtliche führung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>274024d1c45dc56a82612f8c71e727de</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>221</td>\n",
" <td>2023-10-13 13:52:42.848999+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>jumper-deluxe (en) – the christmas guided tour</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>576951a8841585f9bb3a6e4b72289f95</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>23</td>\n",
" <td>2023-10-13 13:02:09.521089+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>choco-deluxe – die exklusive gruppenführung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>cc601355e3b07a57631806317f239000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>126</td>\n",
" <td>2023-10-13 13:30:21.301532+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-schule railaway 10%</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>ac0a1b09039cd2f078f2d09404f6c981</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>82</td>\n",
" <td>2023-10-13 13:19:30.511942+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>gutschein saisonkurs</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>8f86ea0275633432963ebdceae17ce7c</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>16</td>\n",
" <td>2023-10-13 13:02:09.517575+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>choco-welt – die öffentliche führung</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>944fc565655297b2e67c4ae00f020074</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>25</td>\n",
" <td>2023-10-13 13:02:09.522012+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>weihnacht-special</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>68c8841c32b53e7ab121a070043ec1c3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>19</td>\n",
" <td>2023-10-13 13:02:09.519025+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>choco-schule – die führung für schulklassen</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>63615b4e41ea135189db55a27c55e481</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>8</td>\n",
" <td>2023-10-13 13:02:09.513651+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>schokoladentour – gruppenticket</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>f227b307bebc96449506e7e344c80e80</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>106</td>\n",
" <td>2023-10-13 13:24:59.981928+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>valentinstags-special</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>c3ff8a48ad090434023c8b84b556babe</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>132</td>\n",
" <td>2023-10-13 13:30:21.303904+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>muttertags-special</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>cb7fd9470daa045117b40a6189e9267f</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>108</td>\n",
" <td>2023-10-13 13:24:59.982672+02:00</td>\n",
" <td>2023-11-03 10:17:04.761407+01:00</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>osterkurs</td>\n",
" <td>1</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>225f5c434a1a05e093ee996b02c774f3</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id created_at updated_at \\\n",
"0 15 2023-10-13 13:02:09.517079+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"1 11 2023-10-13 13:02:09.515135+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"2 12 2023-10-13 13:02:09.515619+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"3 14 2023-10-13 13:02:09.516604+02:00 2023-11-03 10:17:05.663186+01:00 \n",
"4 10 2023-10-13 13:02:09.514640+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"5 18 2023-10-13 13:02:09.518522+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"6 17 2023-10-13 13:02:09.518037+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"7 41 2023-10-13 13:07:51.131668+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"8 3 2023-10-13 13:02:09.510741+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"9 1 2023-10-13 13:02:09.443323+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"10 9 2023-10-13 13:02:09.514157+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"11 7 2023-10-13 13:02:09.513141+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"12 451 2023-10-13 15:49:57.226957+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"13 6 2023-10-13 13:02:09.512552+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"14 4 2023-10-13 13:02:09.511362+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"15 5 2023-10-13 13:02:09.511954+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"16 453 2023-10-13 15:49:57.238792+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"17 759 2023-10-31 03:20:00.509720+01:00 2023-11-03 10:17:04.761407+01:00 \n",
"18 24 2023-10-13 13:02:09.521575+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"19 21 2023-10-13 13:02:09.520019+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"20 40 2023-10-13 13:07:51.131049+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"21 2 2023-10-13 13:02:09.509959+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"22 22 2023-10-13 13:02:09.520492+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"23 20 2023-10-13 13:02:09.519518+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"24 13 2023-10-13 13:02:09.516105+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"25 103 2023-10-13 13:24:59.980586+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"26 81 2023-10-13 13:19:30.509755+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"27 221 2023-10-13 13:52:42.848999+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"28 23 2023-10-13 13:02:09.521089+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"29 126 2023-10-13 13:30:21.301532+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"30 82 2023-10-13 13:19:30.511942+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"31 16 2023-10-13 13:02:09.517575+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"32 25 2023-10-13 13:02:09.522012+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"33 19 2023-10-13 13:02:09.519025+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"34 8 2023-10-13 13:02:09.513651+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"35 106 2023-10-13 13:24:59.981928+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"36 132 2023-10-13 13:30:21.303904+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"37 108 2023-10-13 13:24:59.982672+02:00 2023-11-03 10:17:04.761407+01:00 \n",
"\n",
" season_id facility_id name \\\n",
"0 1 2 „kreativ mit allen sinnen\" \n",
"1 1 1 truffes zauber \n",
"2 1 1 choco-schule li – die führung für oberstufen &... \n",
"3 1 1 „formen & veredeln\" \n",
"4 1 2 truffes zauber \n",
"5 1 1 choco-welt – die öffentliche führung \n",
"6 1 1 schokoladentour – familien \n",
"7 1 2 ausfahrtsticket \n",
"8 1 1 choco-welt – gruppenführung \n",
"9 1 1 schokoladentour – einzelticket \n",
"10 1 1 „formen & veredeln\" \n",
"11 1 2 choco-deluxe – die öffentliche führung \n",
"12 1 1 weihnachts-special \n",
"13 1 2 gutschein schokoladentour \n",
"14 1 1 choco-deluxe – die öffentliche führung (de) \n",
"15 1 1 „kreativ mit allen sinnen\" \n",
"16 1 1 privater chocolateria workshop \n",
"17 1 1 choco-schule i – die führung für primarschulkl... \n",
"18 1 2 choco-welt – die gruppenführung \n",
"19 1 2 chocolateria \n",
"20 1 2 verlängerungspauschale führungen \n",
"21 1 1 choco-deluxe – die öffentliche führung (en) \n",
"22 1 1 weihnacht-special \n",
"23 1 2 gutschein gruppentarife \n",
"24 1 1 choco-deluxe – die exklusive gruppenführung \n",
"25 1 1 choco-schule l – die führung für primarschulkl... \n",
"26 1 1 jumper-deluxe (de) – die weihnachtliche führung \n",
"27 1 1 jumper-deluxe (en) – the christmas guided tour \n",
"28 1 2 choco-deluxe – die exklusive gruppenführung \n",
"29 1 1 choco-schule railaway 10% \n",
"30 1 2 gutschein saisonkurs \n",
"31 1 2 choco-welt – die öffentliche führung \n",
"32 1 2 weihnacht-special \n",
"33 1 1 choco-schule – die führung für schulklassen \n",
"34 1 1 schokoladentour – gruppenticket \n",
"35 1 1 valentinstags-special \n",
"36 1 1 muttertags-special \n",
"37 1 1 osterkurs \n",
"\n",
" event_type_id manual_added is_display event_type_key_id \\\n",
"0 1 False True 1 \n",
"1 1 False True 1 \n",
"2 1 False True 1 \n",
"3 44 False True 1 \n",
"4 1 False True 1 \n",
"5 1 False True 1 \n",
"6 1 False True 1 \n",
"7 1 False True 1 \n",
"8 1 False True 1 \n",
"9 1 False True 1 \n",
"10 1 False True 1 \n",
"11 1 False True 1 \n",
"12 1 False True 1 \n",
"13 1 False True 1 \n",
"14 1 False True 1 \n",
"15 1 False True 1 \n",
"16 1 False True 1 \n",
"17 1 False True 1 \n",
"18 1 False True 1 \n",
"19 1 False True 1 \n",
"20 1 False True 1 \n",
"21 1 False True 1 \n",
"22 1 False True 1 \n",
"23 1 False True 1 \n",
"24 1 False True 1 \n",
"25 1 False True 1 \n",
"26 1 False True 1 \n",
"27 1 False True 1 \n",
"28 1 False True 1 \n",
"29 1 False True 1 \n",
"30 1 False True 1 \n",
"31 1 False True 1 \n",
"32 1 False True 1 \n",
"33 1 False True 1 \n",
"34 1 False True 1 \n",
"35 1 False True 1 \n",
"36 1 False True 1 \n",
"37 1 False True 1 \n",
"\n",
" facility_key_id identifier \n",
"0 2 08f32b3fd76fcbfcb949502f4a78b052 \n",
"1 1 0eafeafe7396fea2284da359febb069d \n",
"2 1 235c4d3206c90b61f668e0e8051cdf33 \n",
"3 2 ed3d806039d13f9a7999033ef68ebe81 \n",
"4 2 1d4c8761a169128962464ec99ba135f8 \n",
"5 1 e4e2915fd5ba2a5d14fb51d8df063bed \n",
"6 1 5bf172dd5a3bf11f2b346eee5588c97a \n",
"7 2 04fe59a3f6db96a83f6c9734905acb7e \n",
"8 1 8cf7a143170249b3286c2b76b9580f4b \n",
"9 1 34c2ab5c6c6750f78d6e475023db1dcb \n",
"10 1 40d0622668130a47c06aa63742cc1c55 \n",
"11 2 af69a8da972bb9975f78748655a6bdad \n",
"12 1 e48ae983e2654f7dd1055f0ed25b4155 \n",
"13 2 662a3e0d8e88a64afb792d6aecc20395 \n",
"14 1 98e165773ac25e1ef8ef84ccc8c45eb4 \n",
"15 1 8180dfe4fc995269bfac5336c13ec931 \n",
"16 1 7cc2c03196cdc8adfc4102c87f15056e \n",
"17 1 582a63d22864911766d8e019c277d1b3 \n",
"18 2 9fa748c7defa0d4f6976faa875d8c394 \n",
"19 2 169b7c348566ccfd0e6ccdeeb6ac5f5a \n",
"20 2 d22a3ae3c0712be5dfe9858b97a22034 \n",
"21 1 84d0ef8ed664798bfa6a0d297f45bf2d \n",
"22 1 634f074cc18efa0e0ce88bdec14f248e \n",
"23 2 f005c784b0a8db8244177e61e774a9b6 \n",
"24 1 acb6ff9ac2bac1c55043bcb67a72a3a0 \n",
"25 1 7b44ae19449523c65c1140c8aa4db924 \n",
"26 1 274024d1c45dc56a82612f8c71e727de \n",
"27 1 576951a8841585f9bb3a6e4b72289f95 \n",
"28 2 cc601355e3b07a57631806317f239000 \n",
"29 1 ac0a1b09039cd2f078f2d09404f6c981 \n",
"30 2 8f86ea0275633432963ebdceae17ce7c \n",
"31 2 944fc565655297b2e67c4ae00f020074 \n",
"32 2 68c8841c32b53e7ab121a070043ec1c3 \n",
"33 1 63615b4e41ea135189db55a27c55e481 \n",
"34 1 f227b307bebc96449506e7e344c80e80 \n",
"35 1 c3ff8a48ad090434023c8b84b556babe \n",
"36 1 cb7fd9470daa045117b40a6189e9267f \n",
"37 1 225f5c434a1a05e093ee996b02c774f3 "
]
},
2024-02-20 02:27:30 +01:00
"execution_count": 342,
2024-02-20 02:03:23 +01:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_event"
]
},
{
"cell_type": "code",
"execution_count": 277,
"id": "27ce6b38-505e-461d-985f-aab803be190e",
"metadata": {},
"outputs": [],
"source": [
"entreprise_101 = 'bdc2324-data/101/101' + 'event_types' + '.csv'\n",
"with fs.open(entreprise_101, mode=\"rb\") as file_in:\n",
" df_event_types_101= pd.read_csv(file_in, sep=\",\")"
]
},
{
"cell_type": "code",
"execution_count": 278,
"id": "f3fcdd71-0f5f-42a7-83e5-c0b9613b9e91",
"metadata": {},
"outputs": [],
"source": [
"dfs['df_event_types_101']=df_event_types_101"
]
},
{
"cell_type": "code",
"execution_count": 72,
"id": "eccdaffd-9971-45a9-be39-6d3a95a91b2f",
"metadata": {},
"outputs": [
{
"ename": "IndentationError",
"evalue": "expected an indented block after 'for' statement on line 1 (2015796903.py, line 2)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn[72], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m entreprise1 = 'bdc2324-data/i/i' + 'event_types' + '.csv'\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block after 'for' statement on line 1\n"
]
}
],
"source": [
"for i in range(14):\n",
"entreprise_i = 'bdc2324-data/i/i' + 'event_types' + '.csv'\n",
"with fs.open(entreprise1, mode=\"rb\") as file_in:\n",
" df_event_types_'i'= pd.read_csv(file_in, sep=\",\")"
]
},
{
"cell_type": "code",
"execution_count": 191,
"id": "18820c35-7da3-4520-b645-1a467104ddc8",
"metadata": {},
"outputs": [],
"source": [
"del dfs"
]
},
{
"cell_type": "code",
"execution_count": 293,
"id": "9b4a932f-cbb7-4057-bf96-b5d2fd7036a4",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"\n",
"# Création d'un dictionnaire pour stocker les DataFrames events de chaque compagnie\n",
"dfs = {}\n",
"\n",
"for i in range(1, 15): # Assurez-vous que i varie de 1 à 4\n",
" entreprise_i = f'bdc2324-data/{i}/{i}events.csv' # Utilisation de f-strings pour formater la chaîne\n",
" with fs.open(entreprise_i, mode=\"rb\") as file_in: # Utilisation de fsspec.open pour ouvrir le fichier\n",
" df_events_i = pd.read_csv(file_in, sep=\",\") # Lecture du fichier CSV et assignation à un DataFrame\n",
" dfs[f'df_events_{i}'] = df_events_i # Stockage du DataFrame dans le dictionnaire avec une clé appropriée\n"
]
},
{
"cell_type": "code",
"execution_count": 246,
"id": "14ed2fa0-0ec6-4a49-a4d9-183a77326f5d",
"metadata": {},
"outputs": [],
"source": [
"pd.set_option('display.max_rows', 1000)#afficher les ligne maximales"
]
},
{
"cell_type": "code",
"execution_count": 295,
"id": "0ac766c6-1960-4422-bf2c-4ba924394998",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>created_at</th>\n",
" <th>updated_at</th>\n",
" <th>season_id</th>\n",
" <th>facility_id</th>\n",
" <th>name</th>\n",
" <th>event_type_id</th>\n",
" <th>manual_added</th>\n",
" <th>is_display</th>\n",
" <th>event_type_key_id</th>\n",
" <th>facility_key_id</th>\n",
" <th>identifier</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>14370</td>\n",
" <td>2023-04-27 15:40:36.110558+02:00</td>\n",
" <td>2023-10-20 12:55:20.877464+02:00</td>\n",
" <td>1435</td>\n",
" <td>1044</td>\n",
" <td>abonnement - saison 2023 - 2024</td>\n",
" <td>1123</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>1123</td>\n",
" <td>1044</td>\n",
" <td>ee604d3e64a27c663a3a1d9de76596e1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>17634</td>\n",
" <td>2023-07-06 18:02:47.697110+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>1435</td>\n",
" <td>832</td>\n",
" <td>sf paris / racing 92</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>22d7950f7cbce0f2c8f3c4d272ed6926</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>17635</td>\n",
" <td>2023-07-06 18:02:47.697577+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>1435</td>\n",
" <td>832</td>\n",
" <td>sf paris / stade toulousain</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>4ae51c31e231eaca1bc2db3afafe417b</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>17632</td>\n",
" <td>2023-07-06 18:02:47.694821+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>1435</td>\n",
" <td>832</td>\n",
" <td>sf paris / montpellier hr</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>389c8fb7577d0ab030d53e521fda600c</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>17633</td>\n",
" <td>2023-07-06 18:02:47.696477+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>1435</td>\n",
" <td>832</td>\n",
" <td>sf paris / castres olympique</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>05c9dc3878a4c5c3bfe87bc7667c52d8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>214</th>\n",
" <td>8810</td>\n",
" <td>2023-04-04 18:21:47.463967+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>672</td>\n",
" <td>832</td>\n",
" <td>sf paris / racing 92 (ercc)</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>019a7e2faca12acff64ef458cf0c5975</td>\n",
" </tr>\n",
" <tr>\n",
" <th>215</th>\n",
" <td>8804</td>\n",
" <td>2023-04-04 18:21:47.457687+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>672</td>\n",
" <td>832</td>\n",
" <td>sf paris / stade toulousain</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>ef8b8362079d64a10811ac758ca22a63</td>\n",
" </tr>\n",
" <tr>\n",
" <th>216</th>\n",
" <td>8800</td>\n",
" <td>2023-04-04 18:21:47.453369+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>672</td>\n",
" <td>832</td>\n",
" <td>sf paris / stade rochelais</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>451e36ee5ad882a0c25447e2e129fedd</td>\n",
" </tr>\n",
" <tr>\n",
" <th>217</th>\n",
" <td>8806</td>\n",
" <td>2023-04-04 18:21:47.459782+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>672</td>\n",
" <td>832</td>\n",
" <td>sf paris / section paloise</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>2fbea7b0e293de5bf9e9f11d7a4780f8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>218</th>\n",
" <td>8807</td>\n",
" <td>2023-04-04 18:21:47.460842+02:00</td>\n",
" <td>2023-10-20 12:55:20.854693+02:00</td>\n",
" <td>672</td>\n",
" <td>832</td>\n",
" <td>sf paris / ca brive-correze</td>\n",
" <td>824</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
" <td>824</td>\n",
" <td>832</td>\n",
" <td>64af51a1bcd04ca63b4d824379283aeb</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>219 rows × 12 columns</p>\n",
"</div>"
],
"text/plain": [
" id created_at \\\n",
"0 14370 2023-04-27 15:40:36.110558+02:00 \n",
"1 17634 2023-07-06 18:02:47.697110+02:00 \n",
"2 17635 2023-07-06 18:02:47.697577+02:00 \n",
"3 17632 2023-07-06 18:02:47.694821+02:00 \n",
"4 17633 2023-07-06 18:02:47.696477+02:00 \n",
".. ... ... \n",
"214 8810 2023-04-04 18:21:47.463967+02:00 \n",
"215 8804 2023-04-04 18:21:47.457687+02:00 \n",
"216 8800 2023-04-04 18:21:47.453369+02:00 \n",
"217 8806 2023-04-04 18:21:47.459782+02:00 \n",
"218 8807 2023-04-04 18:21:47.460842+02:00 \n",
"\n",
" updated_at season_id facility_id \\\n",
"0 2023-10-20 12:55:20.877464+02:00 1435 1044 \n",
"1 2023-10-20 12:55:20.854693+02:00 1435 832 \n",
"2 2023-10-20 12:55:20.854693+02:00 1435 832 \n",
"3 2023-10-20 12:55:20.854693+02:00 1435 832 \n",
"4 2023-10-20 12:55:20.854693+02:00 1435 832 \n",
".. ... ... ... \n",
"214 2023-10-20 12:55:20.854693+02:00 672 832 \n",
"215 2023-10-20 12:55:20.854693+02:00 672 832 \n",
"216 2023-10-20 12:55:20.854693+02:00 672 832 \n",
"217 2023-10-20 12:55:20.854693+02:00 672 832 \n",
"218 2023-10-20 12:55:20.854693+02:00 672 832 \n",
"\n",
" name event_type_id manual_added is_display \\\n",
"0 abonnement - saison 2023 - 2024 1123 False True \n",
"1 sf paris / racing 92 824 False True \n",
"2 sf paris / stade toulousain 824 False True \n",
"3 sf paris / montpellier hr 824 False True \n",
"4 sf paris / castres olympique 824 False True \n",
".. ... ... ... ... \n",
"214 sf paris / racing 92 (ercc) 824 False True \n",
"215 sf paris / stade toulousain 824 False True \n",
"216 sf paris / stade rochelais 824 False True \n",
"217 sf paris / section paloise 824 False True \n",
"218 sf paris / ca brive-correze 824 False True \n",
"\n",
" event_type_key_id facility_key_id identifier \n",
"0 1123 1044 ee604d3e64a27c663a3a1d9de76596e1 \n",
"1 824 832 22d7950f7cbce0f2c8f3c4d272ed6926 \n",
"2 824 832 4ae51c31e231eaca1bc2db3afafe417b \n",
"3 824 832 389c8fb7577d0ab030d53e521fda600c \n",
"4 824 832 05c9dc3878a4c5c3bfe87bc7667c52d8 \n",
".. ... ... ... \n",
"214 824 832 019a7e2faca12acff64ef458cf0c5975 \n",
"215 824 832 ef8b8362079d64a10811ac758ca22a63 \n",
"216 824 832 451e36ee5ad882a0c25447e2e129fedd \n",
"217 824 832 2fbea7b0e293de5bf9e9f11d7a4780f8 \n",
"218 824 832 64af51a1bcd04ca63b4d824379283aeb \n",
"\n",
"[219 rows x 12 columns]"
]
},
"execution_count": 295,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dfs['df_events_5']"
]
},
{
"cell_type": "code",
"execution_count": 321,
"id": "e3e46c87-a516-474f-b123-455e345fbb36",
"metadata": {},
"outputs": [],
"source": [
"compagnie_event={\n",
" 'compagnie1':['museum','bdc2324-data/1'],\n",
" 'compagnie2':['museum','bdc2324-data/2'],\n",
" 'compagnie3':['museum','bdc2324-data/3'],\n",
" 'compagnie4':['museum','bdc2324-data/4'],\n",
" 'compagnie5':['sport','bdc2324-data/5'],\n",
" 'compagnie6':['sport','bdc2324-data/6'],\n",
" 'compagnie7':['sport','bdc2324-data/7'],\n",
" 'compagnie8':['sport','bdc2324-data/8'],\n",
" 'compagnie9':['sport','bdc2324-data/9'],\n",
" 'compagnie10':['spectable/theater','bdc2324-data/10'],\n",
" 'compagnie11':['spectable/theater','bdc2324-data/11'],\n",
" 'compagnie12':['spectable/theater','bdc2324-data/12'],\n",
" 'compagnie13':['spectable/theater','bdc2324-data/13'],\n",
" 'compagnie14':['spectable/theater','bdc2324-data/14'],\n",
" 'compagnie101':['museum','bdc2324-data/101']\n",
"}\n"
]
},
{
"cell_type": "code",
"execution_count": 322,
"id": "4c200191-8bfa-44f4-a592-c1393a0e1b0e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"15"
]
},
"execution_count": 322,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(compagnie_event)"
]
},
{
"cell_type": "code",
"execution_count": 323,
"id": "5a8861b2-b466-4429-8cf8-b5a8b48ee32e",
"metadata": {},
"outputs": [],
"source": [
"compagnie_act = pd.DataFrame(compagnie_event)"
]
},
{
"cell_type": "code",
"execution_count": 324,
"id": "b963844d-8516-41e0-8a7e-f797320338cf",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>compagnie1</th>\n",
" <th>compagnie2</th>\n",
" <th>compagnie3</th>\n",
" <th>compagnie4</th>\n",
" <th>compagnie5</th>\n",
" <th>compagnie6</th>\n",
" <th>compagnie7</th>\n",
" <th>compagnie8</th>\n",
" <th>compagnie9</th>\n",
" <th>compagnie10</th>\n",
" <th>compagnie11</th>\n",
" <th>compagnie12</th>\n",
" <th>compagnie13</th>\n",
" <th>compagnie14</th>\n",
" <th>compagnie101</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>museum</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>bdc2324-data/1</td>\n",
" <td>bdc2324-data/2</td>\n",
" <td>bdc2324-data/3</td>\n",
" <td>bdc2324-data/4</td>\n",
" <td>bdc2324-data/5</td>\n",
" <td>bdc2324-data/6</td>\n",
" <td>bdc2324-data/7</td>\n",
" <td>bdc2324-data/8</td>\n",
" <td>bdc2324-data/9</td>\n",
" <td>bdc2324-data/10</td>\n",
" <td>bdc2324-data/11</td>\n",
" <td>bdc2324-data/12</td>\n",
" <td>bdc2324-data/13</td>\n",
" <td>bdc2324-data/14</td>\n",
" <td>bdc2324-data/101</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" compagnie1 compagnie2 compagnie3 compagnie4 \\\n",
"0 museum museum museum museum \n",
"1 bdc2324-data/1 bdc2324-data/2 bdc2324-data/3 bdc2324-data/4 \n",
"\n",
" compagnie5 compagnie6 compagnie7 compagnie8 \\\n",
"0 sport sport sport sport \n",
"1 bdc2324-data/5 bdc2324-data/6 bdc2324-data/7 bdc2324-data/8 \n",
"\n",
" compagnie9 compagnie10 compagnie11 compagnie12 \\\n",
"0 sport spectable/theater spectable/theater spectable/theater \n",
"1 bdc2324-data/9 bdc2324-data/10 bdc2324-data/11 bdc2324-data/12 \n",
"\n",
" compagnie13 compagnie14 compagnie101 \n",
"0 spectable/theater spectable/theater museum \n",
"1 bdc2324-data/13 bdc2324-data/14 bdc2324-data/101 "
]
},
"execution_count": 324,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compagnie_act"
]
},
{
"cell_type": "code",
"execution_count": 325,
"id": "8d7ce22e-d4e8-4cf1-9c04-3bddf50d4381",
"metadata": {},
"outputs": [],
"source": [
"nv_index=['type_event','base_compagnie']\n",
"compagnie_act.index=nv_index"
]
},
{
"cell_type": "code",
"execution_count": 326,
"id": "3b4943ad-75ba-45d8-9442-010ebc18a15d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>compagnie1</th>\n",
" <th>compagnie2</th>\n",
" <th>compagnie3</th>\n",
" <th>compagnie4</th>\n",
" <th>compagnie5</th>\n",
" <th>compagnie6</th>\n",
" <th>compagnie7</th>\n",
" <th>compagnie8</th>\n",
" <th>compagnie9</th>\n",
" <th>compagnie10</th>\n",
" <th>compagnie11</th>\n",
" <th>compagnie12</th>\n",
" <th>compagnie13</th>\n",
" <th>compagnie14</th>\n",
" <th>compagnie101</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>type_event</th>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>museum</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>sport</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>spectable/theater</td>\n",
" <td>museum</td>\n",
" </tr>\n",
" <tr>\n",
" <th>base_compagnie</th>\n",
" <td>bdc2324-data/1</td>\n",
" <td>bdc2324-data/2</td>\n",
" <td>bdc2324-data/3</td>\n",
" <td>bdc2324-data/4</td>\n",
" <td>bdc2324-data/5</td>\n",
" <td>bdc2324-data/6</td>\n",
" <td>bdc2324-data/7</td>\n",
" <td>bdc2324-data/8</td>\n",
" <td>bdc2324-data/9</td>\n",
" <td>bdc2324-data/10</td>\n",
" <td>bdc2324-data/11</td>\n",
" <td>bdc2324-data/12</td>\n",
" <td>bdc2324-data/13</td>\n",
" <td>bdc2324-data/14</td>\n",
" <td>bdc2324-data/101</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" compagnie1 compagnie2 compagnie3 \\\n",
"type_event museum museum museum \n",
"base_compagnie bdc2324-data/1 bdc2324-data/2 bdc2324-data/3 \n",
"\n",
" compagnie4 compagnie5 compagnie6 \\\n",
"type_event museum sport sport \n",
"base_compagnie bdc2324-data/4 bdc2324-data/5 bdc2324-data/6 \n",
"\n",
" compagnie7 compagnie8 compagnie9 \\\n",
"type_event sport sport sport \n",
"base_compagnie bdc2324-data/7 bdc2324-data/8 bdc2324-data/9 \n",
"\n",
" compagnie10 compagnie11 compagnie12 \\\n",
"type_event spectable/theater spectable/theater spectable/theater \n",
"base_compagnie bdc2324-data/10 bdc2324-data/11 bdc2324-data/12 \n",
"\n",
" compagnie13 compagnie14 compagnie101 \n",
"type_event spectable/theater spectable/theater museum \n",
"base_compagnie bdc2324-data/13 bdc2324-data/14 bdc2324-data/101 "
]
},
"execution_count": 326,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compagnie_act"
]
},
{
"cell_type": "code",
"execution_count": 327,
"id": "ede8210c-5d79-4159-8132-85afd0950f85",
"metadata": {},
"outputs": [],
"source": [
"compagnie_act.to_csv(r'C:\\Users\\fanta\\OneDrive\\Bureau\\BDC\\compagnie_type_event.csv', index=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "771079f3-d346-4a63-a987-354b811f5b41",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "eda1201a-2cc1-45bc-bf67-70f426183757",
"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.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}