实施例
我在谷歌搜索多次。我可以逐个替换它,但我想要一个公式删除所有符号一次。 我尝试搜索并替换为(。|,|?|!| ... |),但它不起作用。
答案 0 :(得分:0)
答案 1 :(得分:0)
如果要删除所有pnctuation标记,请使用unicode属性from cartopy.io import shapereader
import numpy as np
import geopandas
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
# get natural earth data (http://www.naturalearthdata.com/)
# get country borders
resolution = '10m'
category = 'cultural'
name = 'admin_0_countries'
shpfilename = shapereader.natural_earth(resolution, category, name)
# read the shapefile using geopandas
df = geopandas.read_file(shpfilename)
# read the german borders
poly = df.loc[df['ADMIN'] == 'Germany']['geometry'].values[0]
ax = plt.axes(projection=ccrs.PlateCarree())
ax.add_geometries(poly, crs=ccrs.PlateCarree(), facecolor='none',
edgecolor='0.5')
ax.set_extent([5, 16, 46.5, 56], crs=ccrs.PlateCarree())
:
\p{Punct}
\p{Punct}+