Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Column names reading csv file python

import pandas as pd
df = pd.read_csv('file.csv', names=['a', 'b', 'c'], header=None)
df.rename(columns = {'a':'A', 'b':'B', 'c':'C'}, inplace = True) 
df.to_csv('file.csv')
Comment

PREVIOUS NEXT
Code Example
Python :: make sure text is on page selenium python 
Python :: how to take unknown number of inputs in python 
Python :: create models in django 
Python :: os.listdir in python 
Python :: modulus of python complex number 
Python :: pandas concatenate 
Python :: how to generate random normal number in python 
Python :: correlation between two columns pandas 
Python :: pandas dataframe scan column for values between numbers 
Python :: pytest run only failed test 
Python :: timeit jupyter 
Python :: save dictionary to file numpy 
Python :: add pip to path 
Python :: python3 yyyymmddhhmmss 
Python :: selenium chromeoptions user agent 
Python :: kaggle vs colab 
Python :: python set remove 
Python :: how to translate to string to different alphabet python 
Python :: pandas subtract days from date 
Python :: how to plot corilation python 
Python :: spacy ner 
Python :: python big comment 
Python :: read json file 
Python :: pandas filter every column not null 
Python :: python check if string is int 
Python :: creating venv on vscode linux 
Python :: python numpy array delete multiple columns 
Python :: pandas shift column down 
Python :: python gui using css 
Python :: password generator in python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =