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


Python NominableSheet.name_columns_by_row方法代码示例

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


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

示例1: test_formatter_by_named_column

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

示例2: test_series

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_columns_by_row [as 别名]
 def test_series(self):
     s = NominableSheet(self.data, "test")
     s.name_columns_by_row(2)
     assert s.colnames == ["Column 1", "Column 2", "Column 3"]
     custom_columns = ["C1", "C2", "C3"]
     s.colnames = custom_columns
     assert s.colnames == custom_columns
开发者ID:chiyodad,项目名称:pyexcel,代码行数:9,代码来源:test_sheets.py

示例3: test_add

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

示例4: test_formatter_by_named_columns

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

示例5: test_add_wrong_type

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

示例6: test_set_indexed_row

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

示例7: test_delete_named_column

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_columns_by_row [as 别名]
 def test_delete_named_column(self):
     s = NominableSheet(self.data, "test")
     s.name_columns_by_row(2)
     del s.column["Column 2"]
     assert s.number_of_columns() == 2
     s.column["Column 2"]  # bang
开发者ID:chiyodad,项目名称:pyexcel,代码行数:8,代码来源:test_sheets.py

示例8: test_formatter_by_named_column_2

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

示例9: test_delete_indexed_column

# 需要导入模块: from pyexcel.sheets.nominablesheet import NominableSheet [as 别名]
# 或者: from pyexcel.sheets.nominablesheet.NominableSheet import name_columns_by_row [as 别名]
 def test_delete_indexed_column(self):
     s = NominableSheet(self.data, "test")
     s.name_columns_by_row(0)
     s.delete_named_column_at(1)
     assert s.number_of_columns() == 2
     s.column["Column 2"]  # access it after deletion, bang
开发者ID:chiyodad,项目名称:pyexcel,代码行数:8,代码来源:test_sheets.py


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