Answers for "how to create column names in pandas"

2

add column names to dataframe pandas

# python 3.x
import pandas as pd
import numpy as np

df = pd.DataFrame(data=np.random.randint(0, 10, (6,4)))

df.columns=["a", "b", "c", "d"]
print(df)
Posted by: Guest on July-04-2021
0

name columns pandas

>gapminder.columns = ['country','year','population',
                     'continent','life_exp','gdp_per_cap']
Posted by: Guest on June-08-2020

Code answers related to "how to create column names in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language