如何解决如何查看geopandas数据框中的所有列?
这是我尝试过的:
# load shape file
shpfile = r"...\PycharmProject\maps\CA_Counties\CA_Counties_TIGER2016.shp"
map_df = gpd.read_file(shpfile);
map_df.set_option('display.max_columns',None)
print(map_df.head())
但是它仅显示一些列,类似于数据框。
解决方法
请检查代码段。您无需WITH A as (
SELECT
eventAction,eventCategory,eventLabel,ROW_NUMBER() OVER() as Iterator,FROM `table_1`
),B AS (
SELECT *,ARRAY(SELECT AS STRUCT * FROM `table_3` t,UNNEST(hits) as h
where REGEXP_CONTAINS(h.eventInfo.eventAction,A.eventAction)
and h.eventInfo.eventCategory = A.eventCategory
and REGEXP_CONTAINS(h.eventInfo.eventLabel,A.event_Label)) as table_3_column,FROM A)
SELECT *,CASE
WHEN IFNULL(some_column) then Rotulo
WHEN IFNULL(some_othercolumn) THEN Produto
END AS something_else
FROM B,unnest (table_3_column)
到set_option
,而只需访问库。
代替做
dataframe
尝试一下
map_df.set_option('display.max_columns',None)
将import pandas as pd
pd.set_option('display.max_columns',20)
设置为熊猫而不是数据框
max_columns 不适用于地理数据框对象。您可以做的是将列名转换为列表:
print(map_df.columns.tolist())
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。