Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to create new header of a dataframe in python

 pythonCopy# 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)
Comment

PREVIOUS NEXT
Code Example
Python :: increment in python 
Python :: pytorch load pt file 
Python :: # decorator 
Python :: check if the user is logged in django decorator 
Python :: numpy random for string 
Python :: pickle load data 
Python :: python delete from dictionary 
Python :: numpy declare arraylength 
Python :: Python of add two numbers 
Python :: python rps 
Python :: screen.onkey python 
Python :: sending email with django 
Python :: play sound python 
Python :: Program to find GCD or HCF of two numbers python 
Python :: numpy merge 
Python :: python how to skip iteration 
Python :: python math operators 
Python :: tuple comprehension python 
Python :: how to take space separated input in python 
Python :: search for a word in pdf using python 
Python :: How do I merge two dictionaries in a single expression (taking union of dictionaries)? 
Python :: how to put python code on a website 
Python :: streamlit bold 
Python :: pyqt5 qcombobox get selected item 
Python :: python move and rename files 
Python :: google calendar Request had insufficient authentication scopes. 
Python :: SciPy Convex Hull 
Python :: numpy.sign() in Python 
Python :: python extract string 
Python :: python string manipulation 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =