I am using tabulate (https://pypi.org/project/tabulate/) and I want to format a number column with thousand separator and right align it. This is what I have done and it doesn't right align my column.
import pandas as pd
rom tabulate import tabulate
df = pd.DataFrame([{'size':225612466, 'path': '/etc'}, {'size':66, 'path': '/home'}])
df['size'] = df['size'].apply(lambda x: "{:,}".format(x).rjust(15))
print(tabulate(df, headers='keys', tablefmt='psql', showindex=False))
+--------+-------------+
| path | size |
|--------+-------------|
| /etc | 225,612,466 |
| /home | 66 |
+--------+-------------+
I would like it to be like this:
+--------+-----------------+
| path | size |
|--------+-----------------|
| /etc | 225,612,466 |
| /home | 66 |
+--------+-----------------+
Thanks,