本文整理汇总了Python中pandas.core.indexes.base.default_pprint方法的典型用法代码示例。如果您正苦于以下问题:Python base.default_pprint方法的具体用法?Python base.default_pprint怎么用?Python base.default_pprint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.core.indexes.base
的用法示例。
在下文中一共展示了base.default_pprint方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value)
"""
max_categories = (10 if get_option("display.max_categories") == 0 else
get_option("display.max_categories"))
attrs = [
('categories',
ibase.default_pprint(self.categories,
max_seq_items=max_categories)),
('ordered', self.ordered)]
if self.name is not None:
attrs.append(('name', ibase.default_pprint(self.name)))
attrs.append(('dtype', "'%s'" % self.dtype.name))
max_seq_items = get_option('display.max_seq_items') or len(self)
if len(self) > max_seq_items:
attrs.append(('length', len(self)))
return attrs
# --------------------------------------------------------------------
示例2: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value)
"""
max_categories = (10 if get_option("display.max_categories") == 0 else
get_option("display.max_categories"))
attrs = [
('categories',
ibase.default_pprint(self.categories,
max_seq_items=max_categories)),
('ordered', self.ordered)]
if self.name is not None:
attrs.append(('name', ibase.default_pprint(self.name)))
attrs.append(('dtype', "'%s'" % self.dtype.name))
max_seq_items = get_option('display.max_seq_items') or len(self)
if len(self) > max_seq_items:
attrs.append(('length', len(self)))
return attrs
示例3: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value)
"""
attrs = [
('levels', ibase.default_pprint(self._levels,
max_seq_items=False)),
('codes', ibase.default_pprint(self._codes,
max_seq_items=False))]
if com._any_not_none(*self.names):
attrs.append(('names', ibase.default_pprint(self.names)))
if self.sortorder is not None:
attrs.append(('sortorder', ibase.default_pprint(self.sortorder)))
return attrs
示例4: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr, formatted_value)
"""
attrs = self._get_data_as_items()
if self.name is not None:
attrs.append(('name', ibase.default_pprint(self.name)))
return attrs
示例5: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value)
"""
attrs = [
('levels', ibase.default_pprint(self._levels,
max_seq_items=False)),
('labels', ibase.default_pprint(self._labels,
max_seq_items=False))]
if com._any_not_none(*self.names):
attrs.append(('names', ibase.default_pprint(self.names)))
if self.sortorder is not None:
attrs.append(('sortorder', ibase.default_pprint(self.sortorder)))
return attrs
示例6: _format_attrs
# 需要导入模块: from pandas.core.indexes import base [as 别名]
# 或者: from pandas.core.indexes.base import default_pprint [as 别名]
def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value)
"""
attrs = [
('levels', ibase.default_pprint(self._levels,
max_seq_items=False)),
('labels', ibase.default_pprint(self._labels,
max_seq_items=False))]
if _any_not_none(*self.names):
attrs.append(('names', ibase.default_pprint(self.names)))
if self.sortorder is not None:
attrs.append(('sortorder', ibase.default_pprint(self.sortorder)))
return attrs