I have several data in csv files (similar data structure but not the same), with different sizes of rows and columns for certain lines.
For example, the first three lines of each csv file has varying number of columns, ie:
----------------
Table | Format |
----------------
Code | Label | Index |
-----------------------------------------
a | b | c | d | e |
-----------------------------------------
which does kind of look ugly, and makes it difficult to read in as pandas to work with.
I want to make the table so that it recognizes the max length of columns in a file and add whatever padding to the empty spaces to make the dimensions equal. ie.
-----------------------------------------
Table | Format | pad | pad | pad |
-----------------------------------------
Code | Label | Index | pad | pad |
-----------------------------------------
a | b | c | d | e |
-----------------------------------------
So far, I looked into reading pandas and adding headers to csv file, but because the maximum number of columns for each csv file varies, I've been kind of stuck.
Any help or pointer would be grateful!