Rename

R

> library(dplyr)

> names(data)
[1] “癤퓆o” “group” “onset” “duration”
[5] “time0” “age”
> data2<-rename(data, no = 癤퓆o)
> names(data2)
[1] “no” “group” “onset” “duration”
[5] “time0” “age”

Python

> import pandas as pd

> MyDataFrame = pd.read_csv(‘survival.csv’)

> MyDataFrame.columns
Index([‘id’, ‘age’, ‘sex’], dtype=’object’)

> MyDataFrame2 = MyDataFrame.rename(columns = {‘id’:’no’})

> MyDataFrame2.columns
Index([‘no’, ‘age’, ‘sex’], dtype=’object’)