예제 #1
0
 def test__df_index_name_with_unnamed_multi_index(self, pd):
     arrays = [
         np.array(['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux']),
         np.array(['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two'])
     ]
     df = pd.DataFrame(np.random.randn(8, 4), index=arrays)
     assert df.index.names == [None, None]
     assert ColumnDataSource._df_index_name(df) == "index"
예제 #2
0
파일: test_sources.py 프로젝트: Zyell/bokeh
    def test__df_index_name_with_named_multi_index(self):
        data = io.StringIO(u'''
Fruit,Color,Count,Price
Apple,Red,3,$1.29
Apple,Green,9,$0.99
Pear,Red,25,$2.59
Pear,Green,26,$2.79
Lime,Green,99,$0.39
''')
        df = pd.read_csv(data).set_index(['Fruit', 'Color'])
        assert df.index.names == ['Fruit', 'Color']
        assert ColumnDataSource._df_index_name(df) == "Fruit_Color"
예제 #3
0
    def test__df_index_name_with_named_multi_index(self, pd):
        data = io.StringIO(u'''
Fruit,Color,Count,Price
Apple,Red,3,$1.29
Apple,Green,9,$0.99
Pear,Red,25,$2.59
Pear,Green,26,$2.79
Lime,Green,99,$0.39
''')
        df = pd.read_csv(data).set_index(['Fruit', 'Color'])
        assert df.index.names == ['Fruit', 'Color']
        assert ColumnDataSource._df_index_name(df) == "Fruit_Color"
예제 #4
0
 def test__df_index_name_with_unnamed_index(self, pd):
     df = pd.DataFrame(dict(a=[10], b=[20], c=[30]))
     assert ColumnDataSource._df_index_name(df) == "index"
예제 #5
0
파일: test_sources.py 프로젝트: Zyell/bokeh
 def test__df_index_name_with_unnamed_multi_index(self):
     arrays = [np.array(['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux']),
               np.array(['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two'])]
     df = pd.DataFrame(np.random.randn(8, 4), index=arrays)
     assert df.index.names == [None, None]
     assert ColumnDataSource._df_index_name(df) == "index"
예제 #6
0
파일: test_sources.py 프로젝트: Zyell/bokeh
 def test__df_index_name_with_unnamed_index(self):
     df = pd.DataFrame(dict(a=[10], b=[20], c=[30]))
     assert ColumnDataSource._df_index_name(df) == "index"
예제 #7
0
 def test__df_index_name_with_named_index(self):
     df = pd.DataFrame(dict(a=[10], b=[20], c=[30])).set_index('c')
     assert ColumnDataSource._df_index_name(df) == "c"
예제 #8
0
 def test__df_index_name_with_named_index(self, pd):
     df = pd.DataFrame(dict(a=[10], b=[20], c=[30])).set_index('c')
     assert ColumnDataSource._df_index_name(df) == "c"