本文整理汇总了Python中pyexcel.sheets.nominablesheet.NominableSheet.apply_formatter方法的典型用法代码示例。如果您正苦于以下问题:Python NominableSheet.apply_formatter方法的具体用法?Python NominableSheet.apply_formatter怎么用?Python NominableSheet.apply_formatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyexcel.sheets.nominablesheet.NominableSheet
的用法示例。
在下文中一共展示了NominableSheet.apply_formatter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_formatter_by_named_column
# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import apply_formatter [as 别名]
def test_formatter_by_named_column(self):
"""Test one named column"""
s = NominableSheet(self.data, "test")
s.name_columns_by_row(0)
f = NamedColumnFormatter("Column 1", str)
s.apply_formatter(f)
assert s.column["Column 1"] == ["1", "4", "7"]
示例2: test_formatter_by_named_columns
# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import apply_formatter [as 别名]
def test_formatter_by_named_columns(self):
"""Test multiple named columns"""
s = NominableSheet(self.data, "test")
s.name_columns_by_row(0)
f = NamedColumnFormatter(["Column 1", "Column 3"], str)
s.apply_formatter(f)
assert s.column["Column 1"] == ["1", "4", "7"]
assert s.column["Column 3"] == ["3", "6", "9"]
示例3: test_formatter_by_named_row2
# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import apply_formatter [as 别名]
def test_formatter_by_named_row2(self):
"""Test a list of string as index"""
s = NominableSheet(self.data, "test")
s.name_rows_by_column(0)
f = NamedRowFormatter(["Row 1", "Row 2"], str)
s.apply_formatter(f)
assert s.row["Row 1"] == ["1", "2", "3"]
assert s.row["Row 2"] == ["4", "5", "6"]
示例4: test_formatter_by_named_row
# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import apply_formatter [as 别名]
def test_formatter_by_named_row(self):
s = NominableSheet(self.data, "test")
s.name_rows_by_column(0)
f = NamedRowFormatter("Row 1", str)
s.apply_formatter(f)
assert s.row["Row 1"] == ["1", "2", "3"]