Get your own Python server Result Size: 625 x 565
x
 
import pandas as pd
data = {
  "age": [50, 40, 30],
  "qualified": [True, False, False]
}
df = pd.DataFrame(data)
newdf = df.set_axis(["John", "Peter", "Alex"])
print(newdf)
         age  qualified
  John    50       True
  Peter   40      False
  Alex    30      False