Replies: 1 comment
-
@micycle1, you might want to try something like this: import pandas as pd
from great_tables import GT
df = pd.DataFrame({" a": [1, 2], "2b": [3, 4]})
GT(df).cols_label(**{" a": "a", "2b": "b"}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can one do this?
Renaming columns with
.cols_label()
can be problematic because the column names have to be provided as keyword arguments. This means that one cannot relabel columns that start with numbers or contain spaces, etc because they aren't valid keywords in Python.Beta Was this translation helpful? Give feedback.
All reactions