Python pandas.util.testing.SubclassedCategorical() Examples
The following are 18
code examples of pandas.util.testing.SubclassedCategorical().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pandas.util.testing
, or try the search function
.
Example #1
Source File: test_categorical.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #2
Source File: test_subclass.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #3
Source File: test_subclass.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_from_codes(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)
Example #4
Source File: test_subclass.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #5
Source File: test_subclass.py From coffeegrindsize with MIT License | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #6
Source File: test_subclass.py From coffeegrindsize with MIT License | 5 votes |
def test_from_codes(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)
Example #7
Source File: test_subclass.py From coffeegrindsize with MIT License | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #8
Source File: test_categorical.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #9
Source File: test_categorical.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_from_array(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)
Example #10
Source File: test_subclass.py From recruit with Apache License 2.0 | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #11
Source File: test_subclass.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #12
Source File: test_subclass.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 5 votes |
def test_from_codes(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)
Example #13
Source File: test_subclass.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #14
Source File: test_subclass.py From vnpy_crypto with MIT License | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #15
Source File: test_subclass.py From vnpy_crypto with MIT License | 5 votes |
def test_from_codes(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)
Example #16
Source File: test_subclass.py From vnpy_crypto with MIT License | 5 votes |
def test_constructor(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) tm.assert_categorical_equal(sc, Categorical(['a', 'b', 'c']))
Example #17
Source File: test_subclass.py From recruit with Apache License 2.0 | 5 votes |
def test_map(self): sc = tm.SubclassedCategorical(['a', 'b', 'c']) res = sc.map(lambda x: x.upper()) assert isinstance(res, tm.SubclassedCategorical) exp = Categorical(['A', 'B', 'C']) tm.assert_categorical_equal(res, exp)
Example #18
Source File: test_subclass.py From recruit with Apache License 2.0 | 5 votes |
def test_from_codes(self): sc = tm.SubclassedCategorical.from_codes([1, 0, 2], ['a', 'b', 'c']) assert isinstance(sc, tm.SubclassedCategorical) exp = Categorical.from_codes([1, 0, 2], ['a', 'b', 'c']) tm.assert_categorical_equal(sc, exp)