mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
tabular display: show 10 rows if index is larger than max_rows
This commit is contained in:
parent
394128acf5
commit
b0be68e1db
@ -251,6 +251,7 @@ class DataFrame(NDFrame):
|
||||
width, _ = console.get_console_size()
|
||||
else:
|
||||
width = None
|
||||
|
||||
self.to_string(buf=buf, max_rows=max_rows, max_cols=max_cols,
|
||||
line_width=width, show_dimensions=show_dimensions)
|
||||
|
||||
@ -587,6 +588,10 @@ class DataFrame(NDFrame):
|
||||
"Setting max_rows=60, overwrite if different behaviour is required.")
|
||||
max_rows = 60
|
||||
|
||||
# if the size of the index is larger than max_rows, only show 10 rows
|
||||
if len(self) > max_rows:
|
||||
max_rows = 10
|
||||
|
||||
# Create a slightly bigger dataframe than display
|
||||
df = self._build_repr_df(max_rows + 1, max_cols)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user