alex_bn_lee

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

11 2023 档案

[953] Find contours within a polygon
该文被密码保护。

posted @ 2023-11-29 08:13 McDelfino 阅读(0) 评论(0) 推荐(0) 编辑

[952] Extract text from a PDF file (PyMuPDF | MuPDF | fitz)
摘要:Using PyMuPDF (MuPDF) First, we need to install the PyMuPDF library: pip install pymupdf Then, we can use the following code to extract text from a PD 阅读全文

posted @ 2023-11-24 07:43 McDelfino 阅读(72) 评论(0) 推荐(0) 编辑

[951] Understanding the pattern of "(.*?)" in Python's re package
摘要:In Python's regular expressions, (.*?) is a capturing group with a non-greedy quantifier. Let's break down the components: ( and ): Parentheses are us 阅读全文

posted @ 2023-11-22 13:14 McDelfino 阅读(7) 评论(0) 推荐(0) 编辑

[950] Python RegEx (re library)
摘要:ref: Python RegEx A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern. RegEx can be used to check if a string cont 阅读全文

posted @ 2023-11-22 12:46 McDelfino 阅读(19) 评论(0) 推荐(0) 编辑

[949] Using re to extract unstructured tables of PDF files
摘要:Here is the problem, this unstructured table of a PDF file can not be extrcted as a table directly. We can only extract the whole texts of every page. 阅读全文

posted @ 2023-11-22 11:21 McDelfino 阅读(14) 评论(0) 推荐(0) 编辑

[948] Extract PDF tables that have cells with multiple lines
摘要:If your PDF tables have cells with multiple lines, and you want to merge those lines within the same cell when extracting the table, you might need a 阅读全文

posted @ 2023-11-21 07:58 McDelfino 阅读(28) 评论(0) 推荐(0) 编辑

[947] Batch rename columns in a Pandas DataFrame
摘要:To batch rename columns in a Pandas DataFrame, we can use the rename method. Here is an example: import pandas as pd # Sample DataFrame data = {"ID": 阅读全文

posted @ 2023-11-21 07:36 McDelfino 阅读(10) 评论(0) 推荐(0) 编辑

[946] Add a new row to a Pandas DataFrame
摘要:To add a new row to a Pandas DataFrame, we can use the append method or the loc indexer. Here are examples of both methods: Using append method: impor 阅读全文

posted @ 2023-11-21 07:26 McDelfino 阅读(18) 评论(0) 推荐(0) 编辑

[945] Replacing a string in all cells of a Pandas DataFrame
摘要:To replace a string in all cells of a Pandas DataFrame, we can use the str.replace() method, which allows us to perform string replacements on each el 阅读全文

posted @ 2023-11-20 14:07 McDelfino 阅读(7) 评论(0) 推荐(0) 编辑

[944] Extracting tables from a PDF in Python
摘要:To extract tables from a PDF in Python, we can use several libraries. One popular choice is the tabula-py library, which is a Python wrapper for Apach 阅读全文

posted @ 2023-11-20 13:24 McDelfino 阅读(43) 评论(0) 推荐(0) 编辑

[943] Converting a GeoJSON file to a Shapefile in Python
摘要:To convert a GeoJSON file to a Shapefile in Python, you can use the geopandas library, which provides convenient tools for working with geospatial dat 阅读全文

posted @ 2023-11-17 07:28 McDelfino 阅读(20) 评论(0) 推荐(0) 编辑

[942] Reading PDFs in Python
摘要:To read PDFs in Python, you can use a library called PyPDF2. Here's a simple example to get you started: Install PyPDF2: pip install PyPDF2 Use the li 阅读全文

posted @ 2023-11-17 06:45 McDelfino 阅读(24) 评论(0) 推荐(0) 编辑

[941] re module in Python
摘要:The re module in Python is used for regular expressions. It provides a set of functions that allows us to search a string for a match, replace substri 阅读全文

posted @ 2023-11-17 06:21 McDelfino 阅读(11) 评论(0) 推荐(0) 编辑

[940] Create a progress bar in Python
摘要:To create a progress bar in Python, you can use the tqdm library, which is a popular library for adding progress bars to your loops. If you haven't in 阅读全文

posted @ 2023-11-16 12:43 McDelfino 阅读(12) 评论(0) 推荐(0) 编辑

[939] Generate a new shapefile based on a list of records and query polygons from a large shapefile
摘要:ref: arcpy.management.MakeFeatureLayer(in_features, out_layer, {where_clause}, {workspace}, {field_info}) ref: arcpy.management.SelectLayerByAttribute 阅读全文

posted @ 2023-11-16 11:55 McDelfino 阅读(8) 评论(0) 推荐(0) 编辑

[938] How to operate with shapefiles using Geopandas
摘要:Geopandas is a Python library that makes working with geospatial data easier by extending the data manipulation capabilities of pandas to spatial data 阅读全文

posted @ 2023-11-15 14:04 McDelfino 阅读(18) 评论(0) 推荐(0) 编辑

[937] Combine different shapefiles and remove duplicate features
摘要:In arcpy, you can combine different shapefiles and remove duplicate features using the arcpy.management.Merge tool and the arcpy.management.DeleteIden 阅读全文

posted @ 2023-11-15 13:56 McDelfino 阅读(12) 评论(0) 推荐(0) 编辑

[936] Save a GeoDataFrame as a Shapefile
摘要:In GeoPandas, you can save a GeoDataFrame as a Shapefile using the to_file method. Here's how to do it: import geopandas as gpd # Create or load a Geo 阅读全文

posted @ 2023-11-06 11:51 McDelfino 阅读(31) 评论(0) 推荐(0) 编辑

[935] Python Programming in QGIS3
摘要:ref: Getting Started With Python Programming (QGIS3) ref: 1.4.1. Using PyQGIS in standalone scripts 阅读全文

posted @ 2023-11-03 13:03 McDelfino 阅读(4) 评论(0) 推荐(0) 编辑

[934] Run the python file directly (ArcGIS Pro)
摘要:ref: The Edit with IDLE and Run with ArcGIS Pro options are not available in the context menu when right-clicking Python files Description In some ins 阅读全文

posted @ 2023-11-03 11:00 McDelfino 阅读(12) 评论(0) 推荐(0) 编辑

[933] In ArcPy, how to get the geometry of a feature from a shapefile
摘要:In ArcPy, you can get the geometry of a feature from a shapefile using the SearchCursor or UpdateCursor and the SHAPE@ token to access the geometry of 阅读全文

posted @ 2023-11-02 10:37 McDelfino 阅读(11) 评论(0) 推荐(0) 编辑

[932] In ArcPy, how to get the extent of a shapefile
摘要:In ArcPy, you can get the extent of a shapefile using the Describe function and the extent property. Here's how you can do it: import arcpy # Set the 阅读全文

posted @ 2023-11-02 10:32 McDelfino 阅读(46) 评论(0) 推荐(0) 编辑

[931] arcpy - buffer, delete shp and rename shp
摘要:The script is as follows: arcpy.analysis.Buffer("siteboundary.shp","siteboundary1.shp","-5 Centimeters","FULL","ROUND","NONE",None,"GEODESIC") arcpy.m 阅读全文

posted @ 2023-11-01 14:12 McDelfino 阅读(8) 评论(0) 推荐(0) 编辑

[930] arcpy - change spatial reference, zoom to layer and export to PDF
摘要:The general idea is as follows: aprx -> layout -> map -> layer -> extent layout -> setExtent layout -> exportToPDF The script is as follows: def expor 阅读全文

posted @ 2023-11-01 12:59 McDelfino 阅读(28) 评论(0) 推荐(0) 编辑

[929] datetime format (strftime() and strptime() Format Codes)
摘要:ref: strftime() and strptime() Format Codes The following is a list of all the format codes that the 1989 C standard requires, and these work on all p 阅读全文

posted @ 2023-11-01 07:43 McDelfino 阅读(10) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示