|
49 | 49 |
|
50 | 50 |
|
51 | 51 | common_docstring = """
|
52 |
| - Parameters |
53 |
| - ---------- |
54 |
| - buf : StringIO-like, optional |
55 |
| - buffer to write to |
56 |
| - columns : sequence, optional |
57 |
| - the subset of columns to write; default None writes all columns |
58 |
| - col_space : int, optional |
59 |
| - the minimum width of each column |
60 |
| - header : bool, optional |
61 |
| - %(header)s |
62 |
| - index : bool, optional |
63 |
| - whether to print index (row) labels, default True |
64 |
| - na_rep : string, optional |
65 |
| - string representation of NAN to use, default 'NaN' |
66 |
| - formatters : list or dict of one-parameter functions, optional |
67 |
| - formatter functions to apply to columns' elements by position or name, |
68 |
| - default None. The result of each function must be a unicode string. |
69 |
| - List must be of length equal to the number of columns. |
70 |
| - float_format : one-parameter function, optional |
71 |
| - formatter function to apply to columns' elements if they are floats, |
72 |
| - default None. The result of this function must be a unicode string. |
73 |
| - sparsify : bool, optional |
74 |
| - Set to False for a DataFrame with a hierarchical index to print every |
75 |
| - multiindex key at each row, default True |
76 |
| - index_names : bool, optional |
77 |
| - Prints the names of the indexes, default True |
78 |
| - line_width : int, optional |
79 |
| - Width to wrap a line in characters, default no wrap |
80 |
| - table_id : str, optional |
81 |
| - id for the <table> element create by to_html |
82 |
| -
|
83 |
| - .. versionadded:: 0.23.0""" |
| 52 | + Parameters |
| 53 | + ---------- |
| 54 | + buf : StringIO-like, optional |
| 55 | + Buffer to write to. |
| 56 | + columns : sequence, optional, default None |
| 57 | + The subset of columns to write. Writes all columns by default. |
| 58 | + col_space : int, optional |
| 59 | + The minimum width of each column. |
| 60 | + header : bool, optional |
| 61 | + %(header)s. |
| 62 | + index : bool, optional, default True |
| 63 | + Whether to print index (row) labels. |
| 64 | + na_rep : str, optional, default 'NaN' |
| 65 | + String representation of NAN to use. |
| 66 | + formatters : list or dict of one-param. functions, optional |
| 67 | + Formatter functions to apply to columns' elements by position or |
| 68 | + name. |
| 69 | + The result of each function must be a unicode string. |
| 70 | + List must be of length equal to the number of columns. |
| 71 | + float_format : one-parameter function, optional, default None |
| 72 | + Formatter function to apply to columns' elements if they are |
| 73 | + floats. The result of this function must be a unicode string. |
| 74 | + sparsify : bool, optional, default True |
| 75 | + Set to False for a DataFrame with a hierarchical index to print |
| 76 | + every multiindex key at each row. |
| 77 | + index_names : bool, optional, default True |
| 78 | + Prints the names of the indexes. |
| 79 | + justify : str, default None |
| 80 | + How to justify the column labels. If None uses the option from |
| 81 | + the print configuration (controlled by set_option), 'right' out |
| 82 | + of the box. Valid values are |
| 83 | +
|
| 84 | + * left |
| 85 | + * right |
| 86 | + * center |
| 87 | + * justify |
| 88 | + * justify-all |
| 89 | + * start |
| 90 | + * end |
| 91 | + * inherit |
| 92 | + * match-parent |
| 93 | + * initial |
| 94 | + * unset. |
| 95 | + max_rows : int, optional |
| 96 | + Maximum number of rows to display in the console. |
| 97 | + max_cols : int, optional |
| 98 | + Maximum number of columns to display in the console. |
| 99 | + show_dimensions : bool, default False |
| 100 | + Display DataFrame dimensions (number of rows by number of columns). |
| 101 | + """ |
84 | 102 |
|
85 | 103 | _VALID_JUSTIFY_PARAMETERS = ("left", "right", "center", "justify",
|
86 | 104 | "justify-all", "start", "end", "inherit",
|
87 | 105 | "match-parent", "initial", "unset")
|
88 | 106 |
|
89 |
| -justify_docstring = """ |
90 |
| - justify : str, default None |
91 |
| - How to justify the column labels. If None uses the option from |
92 |
| - the print configuration (controlled by set_option), 'right' out |
93 |
| - of the box. Valid values are |
94 |
| -
|
95 |
| - * left |
96 |
| - * right |
97 |
| - * center |
98 |
| - * justify |
99 |
| - * justify-all |
100 |
| - * start |
101 |
| - * end |
102 |
| - * inherit |
103 |
| - * match-parent |
104 |
| - * initial |
105 |
| - * unset |
106 |
| -""" |
107 |
| - |
108 | 107 | return_docstring = """
|
| 108 | + Returns |
| 109 | + ------- |
| 110 | + str (or unicode, depending on data and options) |
| 111 | + String representation of the dataframe. |
| 112 | + """ |
109 | 113 |
|
110 |
| - Returns |
111 |
| - ------- |
112 |
| - formatted : string (or unicode, depending on data and options)""" |
113 |
| - |
114 |
| -docstring_to_string = common_docstring + justify_docstring + return_docstring |
| 114 | +docstring_to_string = common_docstring + return_docstring |
115 | 115 |
|
116 | 116 |
|
117 | 117 | class CategoricalFormatter(object):
|
@@ -385,7 +385,7 @@ class DataFrameFormatter(TableFormatter):
|
385 | 385 | """
|
386 | 386 |
|
387 | 387 | __doc__ = __doc__ if __doc__ else ''
|
388 |
| - __doc__ += common_docstring + justify_docstring + return_docstring |
| 388 | + __doc__ += common_docstring + return_docstring |
389 | 389 |
|
390 | 390 | def __init__(self, frame, buf=None, columns=None, col_space=None,
|
391 | 391 | header=True, index=True, na_rep='NaN', formatters=None,
|
|
0 commit comments