I'm a newbie to Python and Pandas, I've spent a lot of time searching but haven't been able to find an answer to my particular problem.
I have a dataframe where the first few lines are just comments starting with '#', followed by the usual dataframe containing rows and columns. I have hundreds of such text files that I need to read in and manipulate. For eg.:
'#' blah1
'#' blah2
'#' blah3
Column1 Column2 Column3
a1 b1 c1
a2 b2 c2
etc.
I want to delete all the rows starting with '#'. Can somebody tell me how to do this in Pandas, preferably?
Alternatively, I tried to use the following code to read in the text file:
my_input=pd.read_table(filename, comment='#', header=80)
But the problem was that the header row differs for each text file. Is there a way to generalize and tell Python that my header lies below that last line that starts with a '#'?