v.4.0.2
This commit is contained in:
@@ -2758,22 +2758,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 8,
|
||||
"id": "607bbcc1",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "NameError",
|
||||
"evalue": "name 'os' is not defined",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
||||
"\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
|
||||
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m list_pds = []\n\u001b[32m 2\u001b[39m folder = \u001b[33m'export_landmarks'\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m file \u001b[38;5;28;01min\u001b[39;00m os.listdir(folder):\n\u001b[32m 4\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m file.endswith(\u001b[33m'.csv'\u001b[39m):\n\u001b[32m 5\u001b[39m \u001b[38;5;66;03m# Use os.path.join to ensure the correct file path\u001b[39;00m\n\u001b[32m 6\u001b[39m df = pd.read_csv(os.path.join(folder, file))\n",
|
||||
"\u001b[31mNameError\u001b[39m: name 'os' is not defined"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,pandas as pd\n",
|
||||
"\n",
|
||||
@@ -2786,7 +2774,9 @@
|
||||
" list_pds.append(df)\n",
|
||||
"\n",
|
||||
"# 2. Combine them all at once (Vertical Stack)\n",
|
||||
"global_pd = pd.concat(list_pds, ignore_index=True)"
|
||||
"global_pd = pd.concat(list_pds, ignore_index=True)\n",
|
||||
"\n",
|
||||
"global_pd.to_csv('all_landmarks.csv')"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -2796,17 +2786,21 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"len(global_pd)\n",
|
||||
"# len(global_pd)\n",
|
||||
"\n",
|
||||
"global_pd['garmin_type'].unique()\n",
|
||||
"global_pd['garmin_subtype'].unique()\n",
|
||||
"# global_pd['garmin_type'].unique()\n",
|
||||
"# global_pd['garmin_subtype'].unique()\n",
|
||||
"\n",
|
||||
"water_df = global_pd[global_pd['semantic_tags_json'].str.contains('water', na=False)]\n",
|
||||
"spring = global_pd[global_pd['semantic_tags_json'].str.contains('spring', na=False)]\n",
|
||||
"# water_df = global_pd[global_pd['semantic_tags_json'].str.contains('water', na=False)]\n",
|
||||
"# spring = global_pd[global_pd['semantic_tags_json'].str.contains('spring', na=False)]\n",
|
||||
"\n",
|
||||
"#{\"amenity\": \"drinking_water\"}\n",
|
||||
"#11%\n",
|
||||
"#{\"natural\": \"spring\"}"
|
||||
"# global_water_pd = pd.concat([water_df,spring],ignore_index=True)\n",
|
||||
"# global_water_pd.to_csv('water-landmarks.csv')\n",
|
||||
"# #{\"amenity\": \"drinking_water\"}\n",
|
||||
"# #11%\n",
|
||||
"# #{\"natural\": \"spring\"}\n",
|
||||
"# import json\n",
|
||||
"# amenities = global_pd[global_pd['semantic_tags_json'].str.contains('amenity')]\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -2814,8 +2808,53 @@
|
||||
"execution_count": null,
|
||||
"id": "0791e550",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['0x66' '0x64']\n",
|
||||
"['0x00' '0x14' '0x0e' '0x08' '0x09' '0x16']\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"#extracting \"хижа\"\n",
|
||||
"\n",
|
||||
"living = global_pd[global_pd['semantic_tags_json'].str.contains('хижа', na=False)]\n",
|
||||
"print(living['garmin_type'].unique())\n",
|
||||
"print(living['garmin_subtype'].unique())\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1080c073",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Found 179303 matching entries.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"target_types = ['0x66', '0x64']\n",
|
||||
"target_subtypes = ['0x00', '0x14', '0x0e', '0x08', '0x09', '0x16']\n",
|
||||
"\n",
|
||||
"# Query the big DataFrame for any rows matching both criteria\n",
|
||||
"housing_living = global_pd[\n",
|
||||
" global_pd['garmin_type'].isin(target_types) & \n",
|
||||
" global_pd['garmin_subtype'].isin(target_subtypes)\n",
|
||||
"]\n",
|
||||
"\n",
|
||||
"print(f\"Found {len(housing_living)} matching entries.\")\n",
|
||||
"\n",
|
||||
"housing_living.to_csv('landmark-living-housing-water.csv')"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
491922
parsed-landmarks/all_landmarks.csv
Normal file
491922
parsed-landmarks/all_landmarks.csv
Normal file
File diff suppressed because it is too large
Load Diff
179304
parsed-landmarks/landmark-living-housing-water.csv
Normal file
179304
parsed-landmarks/landmark-living-housing-water.csv
Normal file
File diff suppressed because it is too large
Load Diff
110056
parsed-landmarks/water-landmarks.csv
Normal file
110056
parsed-landmarks/water-landmarks.csv
Normal file
File diff suppressed because it is too large
Load Diff
110056
water-landmarks.csv
Normal file
110056
water-landmarks.csv
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user