Skip to content

How to relabel columns that start with numbers or contain spaces? #355

Closed Answered by jrycw
micycle1 asked this question in Q&A
Discussion options

You must be logged in to vote

@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"})

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by micycle1
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants