pandas set header code example
Example 1: how to add headings to data in pandas
Cov = pd.read_csv("path/to/file.txt", sep='\t')
Frame=pd.DataFrame(Cov.values, columns = ["Sequence", "Start", "End", "Coverage"])
Frame.to_csv("path/to/file.txt", sep='\t')
Example 2: how to change a header in pandas
# Can just use df.columns to rename
>>> df = pd.DataFrame({'$a':[1,2], '$b': [10,20]})
>>> df.columns = ['a', 'b']
>>> df
a b
0 1 10
1 2 20
Example 3: pandas heading
pd.read_csv("directory", heading = None)