• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python nominablesheet.NominableSheet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_series

 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,代码行数:7,代码来源:test_sheets.py


示例2: test_formatter_by_named_column

 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,代码行数:7,代码来源:test_sheets.py


示例3: test_formatter_by_named_columns

 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,代码行数:8,代码来源:test_sheets.py


示例4: test_formatter_by_named_row2

 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,代码行数:8,代码来源:test_sheets.py


示例5: test_add

 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,代码行数:8,代码来源:test_sheets.py


示例6: test_extend_rows_using_wrong_data_type

 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,代码行数:4,代码来源:test_sheets.py


示例7: test_formatter_by_named_column_2

 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,代码行数:5,代码来源:test_sheets.py


示例8: test_set_indexed_column

 def test_set_indexed_column(self):
     s = NominableSheet(self.data, "test", name_rows_by_column=0)
     s.column[0] = [12, 3, 4, 5]
     assert s.column[0] == [12, 3, 4, 5]
开发者ID:chiyodad,项目名称:pyexcel,代码行数:4,代码来源:test_sheets.py


示例9: test_set_named_row

 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,代码行数:5,代码来源:test_sheets.py


示例10: test_delete_indexed_row2

 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,代码行数:6,代码来源:test_sheets.py


示例11: test_add_wrong_type

 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,代码行数:4,代码来源:test_sheets.py


示例12: test_delete_named_column

 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,代码行数:6,代码来源:test_sheets.py


示例13: test_row_series_to_dict

 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,代码行数:6,代码来源:test_sheets.py


示例14: test_formatter_by_named_row_2

 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,代码行数:5,代码来源:test_sheets.py


示例15: test_rownames

 def test_rownames(self):
     s = NominableSheet(self.data, "test", name_rows_by_column=0)
     assert s.rownames == ["Row 0", "Row 1", "Row 2", "Row 3"]
     custom_rows = ["R0", "R1", "R2", "R3"]
     s.rownames = custom_rows
     assert s.rownames == custom_rows
开发者ID:chiyodad,项目名称:pyexcel,代码行数:6,代码来源:test_sheets.py


示例16: test_formatter_by_named_row

 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,代码行数:6,代码来源:test_sheets.py


示例17: test_set_indexed_row

 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,代码行数:5,代码来源:test_sheets.py


示例18: test_delete_indexed_column

 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,代码行数:6,代码来源:test_sheets.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyexcel_io.get_data函数代码示例发布时间:2022-05-25
下一篇:
Python pyexcel.save_book_as函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap