Pandas parsing delimited file
Jump to navigation
Jump to search
No header space delimited
import pandas as pd from tabulate import tabulate df = pd.read_csv('virtualsevers.out', header=None, sep='\s+') df[0][0] print(tabulate(df, showindex=False, headers=df.columns)) for index, row in df.iterrows(): if row[3] != '0' or row[4] != '0' or row[9] != '0': print(row[0]) print(tabulate([row])) # pp.pprint(row.to_frame().T)