У меня есть блок анализа данных, встроенный в ноутбук Google Colab python (3.6).Всякий раз, когда я пытаюсь отобразить встроенный фрейм данных панд (0.23.4), я получаю следующую ошибку:
TypeError: init () получил неожиданный аргумент ключевого слова 'max_rows'
Единственное, что, похоже, решает проблему, - это создание нового ноутбука Colab.(файл> новая записная книжка).Но даже тогда, в конце концов, после некоторого использования в конечном итоге возникает та же проблема.
Также важно отметить, что фрейм данных работает правильно для вычислений и доступа к значениям.Кажется, это проблема при его отображении.
df.head()
Результат:
TypeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in __call__(self, obj)
336 method = get_real_method(obj, self.print_method)
337 if method is not None:
--> 338 return method()
339 return None
340 else:
2 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py in _repr_html_(self)
694 See Also
695 --------
--> 696 to_html : Convert DataFrame to HTML.
697
698 Examples
/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py in to_html(self, buf, columns, col_space, header, index, na_rep, formatters, float_format, sparsify, index_names, justify, bold_rows, classes, escape, max_rows, max_cols, show_dimensions, notebook, decimal, border, table_id)
2035 Dictionary mapping columns containing datetime types to stata
2036 internal format to use when writing the dates. Options are 'tc',
-> 2037 'td', 'tm', 'tw', 'th', 'tq', 'ty'. Column can be either an integer
2038 or a name. Datetime columns that do not have a conversion type
2039 specified will be converted to 'tc'. Raises NotImplementedError if
/usr/local/lib/python3.6/dist-packages/pandas/io/formats/format.py in to_html(self, classes, notebook, border)
751 need_leadsp = dict(zip(fmt_columns, map(is_numeric_dtype, dtypes)))
752
--> 753 def space_format(x, y):
754 if (y not in self.formatters and
755 need_leadsp[x] and not restrict_formatting):
TypeError: __init__() got an unexpected keyword argument 'max_rows'
Ожидаемые результаты - отображение фрейма данных в HTML-таблице.