-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Open
Labels
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
When exporting data frames to Latex, I would like an option to center the table using LaTex \centering command directly using .to_latex() method.
Feature Description
New .to_latex() parameter, eg. centering=
Alternative Solutions
Cycle through exported code and append \centering manually, e. g.
f = open(filename, 'w')
f.write(df.to_latex(...))
f.close()
table = ''
with open(filename, 'r') as f:
while True:
line = f.readline()
if not line:
break
table += line
if 'begin{table}' in line:
table += '\\centering\n'
f.close()
f = open(filename, 'w')
f.write(table)
f.close()
Additional Context
No response
msmojtabafar and Alvaro-Kothe