I frequently find myself writing code like this to get nicely formatted multi-column output (without the index) when debugging or studying my data in pandas:
dfs = dfs[dfs['some_id'] == the_id]
cols = [
'some_col',
'another_col',
'yet_another',
]
print("\t".join(cols))
for row in dfs[cols].values:
print("\t\t".join([str(val) for val in row]))
This works fine, but I was wondering if there's a built in way to get this sort of output with a pandas function or direct lookup syntax. Sample output:
some_col another_col yet_another
a b c
x y z