使用地球和通配符打开文件
我正在尝试使用Glob和通配符从文件夹中读取一组文件,但是Python不会从我的目录中读取_file。
我的代码看起来像这样:
from glob import glob
import geopandas as gpd
extent_dir = glob( '/Users/extents' + '/extent_' + '*.shp' )
extent = gpd.read_file(extent_dir)
我需要使用通配符,因为我将添加带有iDfferent名称的文件。该文件名看起来像这样: lating_1234354.shp
I am trying to read a group of files from a folder using glob and wildcards, however python won't read_file from my directory.
My code looks like this:
from glob import glob
import geopandas as gpd
extent_dir = glob( '/Users/extents' + '/extent_' + '*.shp' )
extent = gpd.read_file(extent_dir)
I need to use the wild card as I will be adding files with idfferent names. the file name looks something like this : extent_1234354.shp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论