Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我打电话给jupyter笔记本geopandas时,它不会读取我的数据_Python_Pandas_Matplotlib_Geopandas - Fatal编程技术网

Python 我打电话给jupyter笔记本geopandas时,它不会读取我的数据

Python 我打电话给jupyter笔记本geopandas时,它不会读取我的数据,python,pandas,matplotlib,geopandas,Python,Pandas,Matplotlib,Geopandas,#首先,我使用新环境安装geopandas和conda,因为我没有在jupyter笔记本的(基座)中安装它。现在我的软件包工作了,但我无法读取数据 这是我的错误: 作为pd进口熊猫 进口土工画板 将numpy作为np导入 将matplotlib.pyplot作为plt导入 进口菲奥纳 ülke = geopandas.read_file("countries.geojson") ------------------------------------------------

#首先,我使用新环境安装geopandas和conda,因为我没有在jupyter笔记本的(基座)中安装它。现在我的软件包工作了,但我无法读取数据 这是我的错误: 作为pd进口熊猫 进口土工画板 将numpy作为np导入 将matplotlib.pyplot作为plt导入 进口菲奥纳

ülke = geopandas.read_file("countries.geojson")

---------------------------------------------------------------------------
CPLE_OpenFailedError                      Traceback (most recent call last)
fiona/_shim.pyx in fiona._shim.gdal_open_vector()

fiona/_err.pyx in fiona._err.exc_wrap_pointer()

CPLE_OpenFailedError: countries.geojson: No such file or directory

During handling of the above exception, another exception occurred:

DriverError                               Traceback (most recent call last)
<ipython-input-6-88e26eb4192f> in <module>
----> 1 ülke = geopandas.read_file("countries.geojson")

~\anaconda3\envs\geo_env\lib\site-packages\geopandas\io\file.py in _read_file(filename, bbox, mask, rows, **kwargs)
    158 
    159     with fiona_env():
--> 160         with reader(path_or_bytes, **kwargs) as features:
    161 
    162             # In a future Fiona release the crs attribute of features will

~\anaconda3\envs\geo_env\lib\site-packages\fiona\env.py in wrapper(*args, **kwargs)
    406     def wrapper(*args, **kwargs):
    407         if local._env:
--> 408             return f(*args, **kwargs)
    409         else:
    410             if isinstance(args[0], str):

~\anaconda3\envs\geo_env\lib\site-packages\fiona\__init__.py in open(fp, mode, driver, schema, crs, encoding, layer, vfs, enabled_drivers, crs_wkt, **kwargs)
    254 
    255         if mode in ('a', 'r'):
--> 256             c = Collection(path, mode, driver=driver, encoding=encoding,
    257                            layer=layer, enabled_drivers=enabled_drivers, **kwargs)
    258         elif mode == 'w':

~\anaconda3\envs\geo_env\lib\site-packages\fiona\collection.py in __init__(self, path, mode, driver, schema, crs, encoding, layer, vsi, archive, enabled_drivers, crs_wkt, ignore_fields, ignore_geometry, **kwargs)
    160             if self.mode == 'r':
    161                 self.session = Session()
--> 162                 self.session.start(self, **kwargs)
    163             elif self.mode in ('a', 'w'):
    164                 self.session = WritingSession()

fiona/ogrext.pyx in fiona.ogrext.Session.start()

fiona/_shim.pyx in fiona._shim.gdal_open_vector()

DriverError: countries.geojson: No such file or directory
enter code here
ulke=geopandas.read_文件(“countries.geojson”)
---------------------------------------------------------------------------
CPLE_OpenFailedError回溯(最近一次呼叫上次)
菲奥娜中的菲奥娜/ySim.Pyx。
菲奥娜中的菲奥娜/yel.Pyx。
CPLE_OpenFailedError:countries.geojson:没有这样的文件或目录
在处理上述异常期间,发生了另一个异常:
DriverError回溯(最近一次呼叫上次)
在里面
---->1ülke=geopandas.read_文件(“countries.geojson”)
读取文件中的~\anaconda3\envs\geo\u env\lib\site packages\geopandas\io\file.py(文件名、bbox、掩码、行、**kwargs)
158
159与fiona_env()
-->160带有读卡器(路径或字节,**kwargs)作为功能:
161
162菲奥娜未来发布CRS属性的特征意志
包装中的~\anaconda3\envs\geo\u env\lib\site packages\fiona\env.py(*args,**kwargs)
406 def包装(*args,**kwargs):
407如果是本地环境:
-->408返回f(*args,**kwargs)
409其他:
410如果存在(args[0],str):
~\anaconda3\envs\geo\u env\lib\site packages\fiona\\uuuuuu init\uuuuuuuuuu.py处于打开状态(fp、模式、驱动程序、架构、crs、编码、层、vfs、启用的\u驱动程序、crs\u wkt、**kwargs)
254
255如果模式为('a','r'):
-->256 c=收集(路径、模式、驱动程序=驱动程序、编码=编码、,
257层=层,启用的驱动程序=启用的驱动程序,**kwargs)
258 elif模式=='w':
~\anaconda3\envs\geo\u env\lib\site packages\fiona\collection.py in\uuuuuuu init\uuuuuuuuuuuuuuuuuu(自身、路径、模式、驱动程序、架构、crs、编码、层、vsi、存档、启用的驱动程序、crs\u wkt、忽略字段、忽略几何体、**kwargs)
160如果self.mode='r':
161 self.session=session()
-->162 self.session.start(self,**kwargs)
163('a','w')中的elif self.mode:
164 self.session=WritingSession()
菲奥娜中的菲奥娜/OGRXX.PYX。
菲奥娜中的菲奥娜/ySim.Pyx。
DriverError:countries.geojson:没有这样的文件或目录
在这里输入代码

来自错误描述:

CPLE\u OpenFailedError:countries.geojson:没有这样的文件或目录

DriverError:countries.geojson:没有这样的文件或目录

从字面上看,您似乎正在尝试从一个工作路径打开文件,而该路径中不存在该文件


请确保您试图读取的文件与Jupyter笔记本位于同一工作目录中,或将本地计算机中的正确路径添加到该文件中。

确保geojson与
.ipynb
文件位于同一目录中

或者,您可以将geojson文件位置放在read语句中,例如:

ülke = geopandas.read_file("C:\user\folder1\folder2\data\countries.geojson")

如果geojson文件是公开的,请将其链接到我们这里好吗?shapeflies也是如此,还是只是geojson文件?