-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
Duplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string
Description
I'd like more flexibility in the stringification of a pandas dataframe. Consider a trivial dataframe:
import pandas as pd
df = pd.DataFrame([[1.2454235445,2],
[3,4.452455]],
columns = ['A','B'])
print(df.to_string())This outputs:
A B
0 1.245424 2.000000
1 3.000000 4.452455
My desired output is:
| | A | B |
+---+----------+----------+
| 0 | 1.245424 | 2.000000 |
| 1 | 3.000000 | 4.452455 |
I suggest adding the following options to to_string() to support the above output:
output_column_separator-- The vertical bar in the above exampleoutput_row_separator-- The hyphen in the above exampleoutput_cross_separator-- The plus sign in the above example
Metadata
Metadata
Assignees
Labels
Duplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestOutput-Formatting__repr__ of pandas objects, to_string__repr__ of pandas objects, to_string