Skip to content

Commit 8941b83

Browse files
committed
Fix undesired UX behavior of DataFrame output in IPython Notebook pandas-dev#10231
1 parent db96085 commit 8941b83

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/whatsnew/v0.16.2.txt

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ New features
2525
Other enhancements
2626
^^^^^^^^^^^^^^^^^^
2727

28+
- Fix undesired UX behavior of DataFrame output in IPython Notebook. (:issue:`10231`)
29+
2830
.. _whatsnew_0162.api:
2931

3032
Backwards incompatible API changes

pandas/core/frame.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ def _repr_html_(self):
538538
max_cols = get_option("display.max_columns")
539539
show_dimensions = get_option("display.show_dimensions")
540540

541-
return ('<div style="max-height:1000px;'
542-
'max-width:1500px;overflow:auto;">\n' +
541+
return ('<div>\n' +
543542
self.to_html(max_rows=max_rows, max_cols=max_cols,
544543
show_dimensions=show_dimensions) + '\n</div>')
545544
else:

pandas/tests/test_format.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ def test_to_html_truncate(self):
892892
fmt.set_option('display.max_columns',4)
893893
result = df._repr_html_()
894894
expected = '''\
895-
<div style="max-height:1000px;max-width:1500px;overflow:auto;">
895+
<div>
896896
<table border="1" class="dataframe">
897897
<thead>
898898
<tr style="text-align: right;">
@@ -993,7 +993,7 @@ def test_to_html_truncate_multi_index(self):
993993
fmt.set_option('display.max_columns',7)
994994
result = df._repr_html_()
995995
expected = '''\
996-
<div style="max-height:1000px;max-width:1500px;overflow:auto;">
996+
<div>
997997
<table border="1" class="dataframe">
998998
<thead>
999999
<tr>
@@ -1110,7 +1110,7 @@ def test_to_html_truncate_multi_index_sparse_off(self):
11101110
fmt.set_option('display.multi_sparse',False)
11111111
result = df._repr_html_()
11121112
expected = '''\
1113-
<div style="max-height:1000px;max-width:1500px;overflow:auto;">
1113+
<div>
11141114
<table border="1" class="dataframe">
11151115
<thead>
11161116
<tr>

0 commit comments

Comments
 (0)