You can rename the column names using pandas rename()
function.
Assuming you have a pandas DataFrame df
with columns named "begindatumtijd" and "einddatumtijd", you can rename them to "begin" and "end" using the following code:
main.py152 chars6 lines
This will print the first five rows of the DataFrame with the new column names. If you want to modify the original DataFrame, you can add the inplace=True
argument to rename()
function.
main.py102 chars3 lines
This will rename column names in place.
gistlibby LogSnag