File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,6 @@ def is_vid(cell):
1616 return text == "<IPython.core.display.Video object>"
1717
1818
19- def fix_sample (line ):
20- """Ensure calls to .sample() are deterministic by passing in a seed value
21-
22- https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sample.html"""
23- return re .sub (r"\.sample\((\d+)\)" , r".sample(\1, random_state=1)" , line )
24-
25-
2619def has_html_output (output ):
2720 return "data" in output and "text/html" in output ["data" ]
2821
@@ -45,7 +38,9 @@ def has_html_output(output):
4538 if cell ["source" ][0 ].startswith ("!" ):
4639 cell ["outputs" ] = []
4740
48- cell ["source" ] = [fix_sample (line ) for line in cell ["source" ]]
41+ # ignore sample() output
42+ if any (".sample(" in line for line in cell ["source" ]):
43+ cell ["outputs" ] = []
4944
5045 # filter out pip upgrade warnings
5146 cell ["outputs" ] = [line for line in cell ["outputs" ] if not is_pip_upgrade_msg (line )]
You can’t perform that action at this time.
0 commit comments