Ejemplo n.º 1
0
 def test_col_order(self):
     dxp.box(x='price',
             y='neighborhood',
             data=airbnb,
             split='superhost',
             col='property_type',
             col_order=['House', 'Condominium'])
Ejemplo n.º 2
0
    def test_x_order(self):
        dxp.box(x='price', y='neighborhood', data=airbnb,
                y_order=['Dupont Circle', 'Edgewood', 'Union Station'])

        with pytest.raises(ValueError):
            dxp.box(x='price', y='neighborhood', data=airbnb,
                y_order=['Dupont Circle', 'Edgewood', 'DOES NOT EXIST'])
Ejemplo n.º 3
0
 def test_col_wrap(self):
     dxp.box(x='price',
             y='neighborhood',
             data=airbnb,
             split='superhost',
             col='property_type',
             wrap=2)
Ejemplo n.º 4
0
 def test_row_col(self):
     dxp.box(x='price',
             y='neighborhood',
             data=airbnb,
             split='superhost',
             col='property_type',
             col_order=['House', 'Condominium', 'Apartment'],
             row='bedrooms',
             row_order=[0, 1, 2, 3])
Ejemplo n.º 5
0
 def test_desc_values(self):
     fig = dxp.box(x='price',
                   y='neighborhood',
                   data=airbnb,
                   sort_values='desc')
     ticklabels = [t.get_text() for t in fig.axes[0].get_xticklabels()]
     ticklabels = [label.replace('\n', ' ') for label in ticklabels]
Ejemplo n.º 6
0
 def test_row(self):
     dxp.box(x='price', y='neighborhood', data=airbnb, 
             split='superhost', row='property_type')
Ejemplo n.º 7
0
 def test_stacked(self):
     dxp.box(x='price', y='neighborhood', data=airbnb, 
             split='superhost', split_order=['Yes', 'No'])
Ejemplo n.º 8
0
 def test_split(self):
     dxp.box(x='price', y='neighborhood', data=airbnb, split='superhost')
Ejemplo n.º 9
0
 def test_vert(self):
     dxp.box(x='neighborhood', y='price', data=airbnb, orientation='v')
Ejemplo n.º 10
0
 def test_lex_desc(self):
     fig = dxp.box(x='price', y='neighborhood', data=airbnb, sort='lex_desc')
     ticklabels = [t.get_text() for t in fig.axes[0].get_xticklabels()]
     correct = sorted(ticklabels, reverse=True)
     assert ticklabels == correct
Ejemplo n.º 11
0
 def test_lex_asc(self):
     fig = dxp.box(x='price', y='neighborhood', data=airbnb)
     ticklabels = [t.get_text() for t in fig.axes[0].get_xticklabels()]
     correct = sorted(ticklabels)
     assert ticklabels == correct