Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas add header to existing dataframe

# 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)
 
PREVIOUS NEXT
Tagged: #pandas #add #header #existing #dataframe
ADD COMMENT
Topic
Name
6+7 =