Old post, but may be interesting: an idea (which is destructive, but does the job if you want it quick and dirty) is to rename columns using underscores:
df1.columns = [c.replace(' ', '_') for c in df1.columns]
More Related Contents:
- Filter pandas DataFrame by substring criteria
- How to test if a string contains one of the substrings in a list, in pandas?
- Pandas filtering for multiple substrings in series
- Remove unwanted parts from strings in a column
- String concatenation of two pandas columns
- Find column whose name contains a specific string
- add a string prefix to each value in a string column using Pandas
- pandas dataframe str.contains() AND operation
- Pandas DataFrame stored list as string: How to convert back to list
- How to remove square bracket from pandas dataframe
- NLTK-based text processing with pandas
- Left justify string values in a pandas DataFrame
- Count number of words per row
- Converting a column within pandas dataframe from int to string
- Capitalize first letter of each word in a dataframe column
- How to use str.contains() with multiple expressions in pandas dataframes
- Copy text between parentheses in pandas DataFrame column into another column
- Fast punctuation removal with pandas
- Rename Pandas DataFrame Index
- What is the fastest way to upload a big csv file in notebook to work with python pandas?
- Merge multiple column values into one column in python pandas
- How do I get the row count of a Pandas DataFrame?
- selecting from multi-index pandas
- Dataframe set_index not setting
- How can I replicate rows in Pandas?
- How to create a DataFrame of random integers with Pandas?
- Create new column based on values from other columns / apply a function of multiple columns, row-wise in Pandas
- Pandas groupby and aggregation output should include all the original columns (including the ones not aggregated on)
- Selecting a range of columns in a dataframe
- Get weekday/day-of-week for Datetime column of DataFrame