mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[pycharm] PY-72208 Tables(Jupyter, SciView): Refactoring, fix tiny errors
GitOrigin-RevId: a936672fbdf51c9692150bd7c78721988abde3f7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2b3832d5a9
commit
cefb5228e1
@@ -49,23 +49,27 @@ def get_data(table, use_csv_serialization, start_index=None, end_index=None, for
|
||||
return computed_data
|
||||
|
||||
|
||||
def __ipython_display(data):
|
||||
from IPython.display import display
|
||||
display(data)
|
||||
|
||||
|
||||
# used by DSTableCommands
|
||||
# noinspection PyUnresolvedReferences
|
||||
def display_data_csv(table, start_index, end_index):
|
||||
# type: (datasets.arrow_dataset.Dataset, int, int) -> None
|
||||
_compute_sliced_data(table, __ipython_display, start_index, end_index)
|
||||
def ipython_display(data):
|
||||
try:
|
||||
data = data.to_csv()
|
||||
except AttributeError:
|
||||
pass
|
||||
print(data)
|
||||
_compute_sliced_data(table, ipython_display, end_index)
|
||||
|
||||
|
||||
# used by DSTableCommands
|
||||
# noinspection PyUnresolvedReferences
|
||||
def display_data_html(table, start_index, end_index):
|
||||
# type: (datasets.arrow_dataset.Dataset, int, int) -> None
|
||||
_compute_sliced_data(table, __ipython_display, start_index, end_index)
|
||||
def ipython_display(data):
|
||||
from IPython.display import display
|
||||
display(data)
|
||||
_compute_sliced_data(table, ipython_display, end_index)
|
||||
|
||||
|
||||
def __get_data_slice(table, start, end):
|
||||
|
||||
@@ -50,23 +50,27 @@ def get_data(table, use_csv_serialization, start_index=None, end_index=None, for
|
||||
return computed_data
|
||||
|
||||
|
||||
def __ipython_display(data):
|
||||
from IPython.display import display
|
||||
display(__convert_to_df(data))
|
||||
|
||||
|
||||
# used by DSTableCommands
|
||||
# noinspection PyUnresolvedReferences
|
||||
def display_data_csv(table, start_index, end_index):
|
||||
# type: (Union[pd.DataFrame, pd.Series], int, int) -> None
|
||||
_compute_sliced_data(table, __ipython_display, start_index, end_index)
|
||||
def ipython_display(data):
|
||||
try:
|
||||
data = data.to_csv()
|
||||
except AttributeError:
|
||||
pass
|
||||
print(__convert_to_df(data))
|
||||
_compute_sliced_data(table, ipython_display, start_index, end_index)
|
||||
|
||||
|
||||
# used by DSTableCommands
|
||||
# noinspection PyUnresolvedReferences
|
||||
def display_data_html(table, start_index, end_index):
|
||||
# type: (Union[pd.DataFrame, pd.Series], int, int) -> None
|
||||
_compute_sliced_data(table, __ipython_display, start_index, end_index)
|
||||
def ipython_display(data):
|
||||
from IPython.display import display
|
||||
display(__convert_to_df(data))
|
||||
_compute_sliced_data(table, ipython_display, start_index, end_index)
|
||||
|
||||
|
||||
def __get_data_slice(table, start, end):
|
||||
|
||||
Reference in New Issue
Block a user