from pandas import read_csv df = read_csv('test.csv') df.columns = ['a', 'b'] df.to_csv('test_2.csv')