小编Geo*_*o-x的帖子

将前缀添加到Dataframe的特定列

我有一个这样的DataFrame:

col1   col2   col3   col4   col5   col6   col7   col8
0      5345   rrf    rrf    rrf    rrf    rrf    rrf
1      2527   erfr   erfr   erfr   erfr   erfr   erfr
2      2727   f      f      f      f      f      f
Run Code Online (Sandbox Code Playgroud)

我想重命名所有列,但不是重命名col1col2.

所以我试着做一个循环

print(df.columns)
    for col in df.columns:
        if col != 'col1' and col != 'col2':
            col.rename = str(col) + '_x'
Run Code Online (Sandbox Code Playgroud)

但它不是很有效......它不起作用!

python pandas

5
推荐指数
3
解决办法
7317
查看次数

在 OpenLayers 3.5.0 中使用 CSS 更改控件样式

我的问题很简单:可以使用 CSS 更改控件按钮样式吗?如果我这样做,我可以不加载 OpenLayers 的 CSS 吗?

openlayers-3

4
推荐指数
1
解决办法
1694
查看次数

标签 统计

openlayers-3 ×1

pandas ×1

python ×1