| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.DataFrame.rename.html | [Back] [Original] |
Section Navigation
Rename columns.
Dict values must be unique (1-to-1). Labels not contained in a dict will be left as-is. Extra labels listed dont throw an error.
Examples:
>>> df = bpd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
>>> df
A B
0 1 4
1 2 5
2 3 6
[3 rows x 2 columns]
Rename columns using a mapping:
>>> df.rename(columns={"A": "col1", "B": "col2"})
col1 col2
0 1 4
1 2 5
2 3 6
[3 rows x 2 columns]
columns (Mapping) Dict-like from old column labels to new column labels.
inplace (bool) Default False. Whether to modify the DataFrame rather than creating a new one.
DataFrame with the renamed axis labels or None if inplace=True.
bigframes.pandas.DataFrame | None
KeyError If any of the labels is not found.
Copyright 2019, Google.
Created using Sphinx 8.1.3.
Built with the PyData Sphinx Theme 0.19.0.
| Web Proxy Viewer | New URL | Original Page |