TL;DR
In the case of csv files, I don't think that there is a comment-out line in the line that starts with #, but bioinformatics-specific gff, vcf, bed, etc. contain comment lines and are normally read by pandas. It was annoying, so I looked it up. Since pandas is smart, it seems to have such a function.
The solution is very simple, just put the first symbol in the comment in the comment argument when loading.
import pandas as pd
df = pd.read_csv("/path/to/file", comment='#')
This eliminates the frustration that cannot be read ...
Recommended Posts