当前位置: 首页>>代码示例>>Python>>正文


Python NominableSheet.name_rows_by_column方法代码示例

本文整理汇总了Python中pyexcel.sheets.nominablesheet.NominableSheet.name_rows_by_column方法的典型用法代码示例。如果您正苦于以下问题:Python NominableSheet.name_rows_by_column方法的具体用法?Python NominableSheet.name_rows_by_column怎么用?Python NominableSheet.name_rows_by_column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyexcel.sheets.nominablesheet.NominableSheet的用法示例。


在下文中一共展示了NominableSheet.name_rows_by_column方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_formatter_by_named_row2

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [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"]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:10,代码来源:test_sheets.py

示例2: test_add

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_add(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     data = OrderedDict({
         "Row 5": [10, 11, 12]
         }
     )
     s = s.row + data
     assert s.row["Row 5"] == [10, 11, 12]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:11,代码来源:test_sheets.py

示例3: test_set_named_row

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_set_named_row(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     s.row["Row 2"] = [11, 11, 11]
     assert s.row["Row 2"] == [11, 11, 11]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:7,代码来源:test_sheets.py

示例4: test_delete_indexed_row2

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_delete_indexed_row2(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     s.delete_named_row_at(2)
     assert s.number_of_rows() == 3
     s.row["Row 2"]  # already deleted
开发者ID:chiyodad,项目名称:pyexcel,代码行数:8,代码来源:test_sheets.py

示例5: test_add_wrong_type

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_add_wrong_type(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     s = s.row + "string type"  # bang
开发者ID:chiyodad,项目名称:pyexcel,代码行数:6,代码来源:test_sheets.py

示例6: test_extend_rows_using_wrong_data_type

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_extend_rows_using_wrong_data_type(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     s.extend_rows([1, 2])
开发者ID:chiyodad,项目名称:pyexcel,代码行数:6,代码来源:test_sheets.py

示例7: test_row_series_to_dict

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_row_series_to_dict(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     content = s.to_dict(True)
     keys = ["Row 0", "Row 1", "Row 2", "Row 3"]
     assert keys == list(content.keys())
开发者ID:chiyodad,项目名称:pyexcel,代码行数:8,代码来源:test_sheets.py

示例8: test_formatter_by_named_row_2

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [as 别名]
 def test_formatter_by_named_row_2(self):
     s = NominableSheet(self.data, "test")
     s.name_rows_by_column(0)
     s.row.format("Row 1", str)
     assert s.row["Row 1"] == ["1", "2", "3"]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:7,代码来源:test_sheets.py

示例9: test_formatter_by_named_row

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_rows_by_column [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"]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:8,代码来源:test_sheets.py


注:本文中的pyexcel.sheets.nominablesheet.NominableSheet.name_rows_by_column方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。