コード例 #1
0
ファイル: test_style.py プロジェクト: zmyer/pandas
 def test_render_double(self):
     df = pd.DataFrame({"A": [0, 1]})
     style = lambda x: pd.Series(
         ["color: red; border: 1px", "color: blue; border: 2px"],
         name=x.name)
     s = Styler(df, uuid='AB').apply(style)
     s.render()
コード例 #2
0
ファイル: test_style.py プロジェクト: wuthmonehnin/pandas
    def test_table_attributes(self):
        attributes = 'class="foo" data-bar'
        styler = Styler(self.df, table_attributes=attributes)
        result = styler.render()
        self.assertTrue('class="foo" data-bar' in result)

        result = self.df.style.set_table_attributes(attributes).render()
        self.assertTrue('class="foo" data-bar' in result)
コード例 #3
0
ファイル: test_style.py プロジェクト: wuthmonehnin/pandas
    def test_uuid(self):
        styler = Styler(self.df, uuid='abc123')
        result = styler.render()
        self.assertTrue('abc123' in result)

        styler = self.df.style
        result = styler.set_uuid('aaa')
        self.assertTrue(result is styler)
        self.assertEqual(result.uuid, 'aaa')
コード例 #4
0
ファイル: test_style.py プロジェクト: wuthmonehnin/pandas
    def test_caption(self):
        styler = Styler(self.df, caption='foo')
        result = styler.render()
        self.assertTrue(all(['caption' in result, 'foo' in result]))

        styler = self.df.style
        result = styler.set_caption('baz')
        self.assertTrue(styler is result)
        self.assertEqual(styler.caption, 'baz')
コード例 #5
0
ファイル: test_style.py プロジェクト: ChristopherShort/pandas
    def test_uuid(self):
        styler = Styler(self.df, uuid="abc123")
        result = styler.render()
        self.assertTrue("abc123" in result)

        styler = self.df.style
        result = styler.set_uuid("aaa")
        self.assertTrue(result is styler)
        self.assertEqual(result.uuid, "aaa")
コード例 #6
0
ファイル: test_style.py プロジェクト: ChristopherShort/pandas
    def test_caption(self):
        styler = Styler(self.df, caption="foo")
        result = styler.render()
        self.assertTrue(all(["caption" in result, "foo" in result]))

        styler = self.df.style
        result = styler.set_caption("baz")
        self.assertTrue(styler is result)
        self.assertEqual(styler.caption, "baz")
コード例 #7
0
ファイル: test_style.py プロジェクト: wuthmonehnin/pandas
    def test_table_styles(self):
        style = [{'selector': 'th', 'props': [('foo', 'bar')]}]
        styler = Styler(self.df, table_styles=style)
        result = ' '.join(styler.render().split())
        self.assertTrue('th { foo: bar; }' in result)

        styler = self.df.style
        result = styler.set_table_styles(style)
        self.assertTrue(styler is result)
        self.assertEqual(styler.table_styles, style)
コード例 #8
0
ファイル: test_style.py プロジェクト: ChristopherShort/pandas
    def test_table_styles(self):
        style = [{"selector": "th", "props": [("foo", "bar")]}]
        styler = Styler(self.df, table_styles=style)
        result = " ".join(styler.render().split())
        self.assertTrue("th { foo: bar; }" in result)

        styler = self.df.style
        result = styler.set_table_styles(style)
        self.assertTrue(styler is result)
        self.assertEqual(styler.table_styles, style)
コード例 #9
0
ファイル: test_style.py プロジェクト: ivannz/pandas
 def test_render_double(self):
     df = pd.DataFrame({"A": [0, 1]})
     style = lambda x: pd.Series(["color: red; border: 1px",
                                  "color: blue; border: 2px"], name=x.name)
     s = Styler(df, uuid='AB').apply(style)
     s.render()
コード例 #10
0
ファイル: test_style.py プロジェクト: ChristopherShort/pandas
 def test_render(self):
     df = pd.DataFrame({"A": [0, 1]})
     style = lambda x: pd.Series(["color: red", "color: blue"], name=x.name)
     s = Styler(df, uuid="AB").apply(style)
     s.render()
コード例 #11
0
 def test_render(self):
     df = pd.DataFrame({"A": [0, 1]})
     style = lambda x: pd.Series(["color: red", "color: blue"], name=x.name)
     s = Styler(df, uuid='AB').apply(style).apply(style, axis=1)
     s.render()