alex_bn_lee

导航

随笔分类 -  Python Study

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页

Study of Python.
[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 阅读(138) 评论(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 阅读(13) 评论(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 阅读(47) 评论(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 阅读(28) 评论(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 阅读(55) 评论(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 阅读(21) 评论(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 阅读(39) 评论(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 阅读(25) 评论(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 阅读(81) 评论(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 阅读(41) 评论(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 阅读(50) 评论(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 阅读(20) 评论(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 阅读(24) 评论(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 阅读(20) 评论(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 阅读(47) 评论(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 阅读(37) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 31 下一页