Adding Header To A Dataframe Pandas
i have a DataFrame: Index 1 Dr. Santosh Kumar 0 NaN BHR/ 6681/148/1/134094/2007-08/L 1 NaN B/301, Laxmi Apartment 2 NaN New Chitragupta Nagar, Kankerbagh 3
Solution 1:
Try:
df = pd.DataFrame(
np.row_stack([df.columns, df.values]),
columns=['id', 'information']
)
Post a Comment for "Adding Header To A Dataframe Pandas"