Q:

How to Read A CSV With A Variable Number of Columns?

My csv file looks like this:
5783,145v
g656,4589,3243,tt56
6579

How do I read this with pandas (or otherwise)?
(the table should contain empty cells)

A:

You could pass a dummy separator, and then use str.split (by ",") with expand=True:
df = pd.read_csv('path/to/file.csv', sep=" ", header=None)
df = df[0].str.split(",", expand=True).fillna("")
print(df)

Output
      0     1     2     3
0  5783  145v            
1  g656  4589  3243  tt56
2  6579                  

