pandas style.hide_index()和pandas style.hide_columns()

运行后没有隐藏索引和指定的columns

import pandas as pd

df = pd.DataFrame({'a': [1], 'b': [2]})
df.style.hide_index()
print(df)
df.style.hide_columns(['a'])
print(df)

img

样式是用来给UI用的,
你都没有UI,print打印的是原始数据,样式不起作用