1. 主页
  2. 文档
  3. GeoPandas 0.12.2中文文档
  4. User Guide
  5. Data Structures
  6. Display options

Display options

GeoPandas has an options attribute with currently a single configuration option to control:

GeoPandas 有一个 options 属性,目前只有一个配置选项来控制.

In [11]: import geopandas

geopandas.options
Out[11]: 
Options(
  display_precision: None [default: None]
      The precision (maximum number of decimals) of the coordinates in the
      WKT representation in the Series/DataFrame display. By default (None),
      it tries to infer and use 3 decimals for projected coordinates and 5
      decimals for geographic coordinates.
  use_pygeos: True [default: True]
      Whether to use PyGEOS to speed up spatial operations. The default is
      True if PyGEOS is installed, and follows the USE_PYGEOS environment
      variable if set.
  )

The geopandas.options.display_precision option can control the number of decimals to show in the display of coordinates in the geometry column. In the world example of above, the default is to show 5 decimals for geographic coordinates:

geopandas.options.display_precision 选项可以控制在几何列的坐标显示中显示的小数位数。在上面的world示例中,默认情况下地理坐标显示 5 位小数。

In [12]: world['centroid_column'].head()
Out[12]: 
0    POINT (163.85316 -17.31631)
1      POINT (34.75299 -6.25773)
2     POINT (-12.13783 24.29117)
3     POINT (-98.14238 61.46908)
4    POINT (-112.59944 45.70563)
Name: centroid_column, dtype: geometry

If you want to change this, for example to see more decimals, you can do:

如果你想改变这一点,例如想看到更多的小数,你可以这样做。

In [13]: geopandas.options.display_precision = 9

In [14]:world['centroid_column'].head()
Out[14]: 
0    POINT (163.853164645 -17.316309426)
1      POINT (34.752989855 -6.257732429)
2     POINT (-12.137831112 24.291172960)
3     POINT (-98.142381372 61.469076145)
4    POINT (-112.599435912 45.705628002)
Name: centroid_column, dtype: geometry
标签 , ,
这篇文章对您有用吗?

我们要如何帮助您?

欢迎留下您的宝贵建议

Please enter your comment!
Please enter your name here