Ejemplo n.º 1
0
 def currencies(self):
     """Row labels for rate groups."""
     # Currencies are stored as fixed-length bytes in the file, but we want
     # `str` objects in memory.
     bytes_array = self._group[INDEX][CURRENCIES][:]
     objects = bytes_array_to_native_str_object_array(bytes_array)
     return pd.Index(objects)
Ejemplo n.º 2
0
 def _currency_codes(self):
     bytes_array = self._country_group[CURRENCY][CODE][:]
     return bytes_array_to_native_str_object_array(bytes_array)
Ejemplo n.º 3
0
    def test_bytes_array_to_native_str_object_array(self):
        a = array([b'abc', b'def'], dtype='S3')
        result = bytes_array_to_native_str_object_array(a)
        expected = array(['abc', 'def'], dtype=object)

        assert_equal(result, expected)
Ejemplo n.º 4
0
def test_bytes_array_to_native_str_object_array():
    a = np.array([b"abc", b"def"], dtype="S3")
    result = bytes_array_to_native_str_object_array(a)
    expected = np.array(["abc", "def"], dtype=object)
    np.testing.assert_array_equal(result, expected)
Ejemplo n.º 5
0
    def test_bytes_array_to_native_str_object_array(self):
        a = array([b"abc", b"def"], dtype="S3")
        result = bytes_array_to_native_str_object_array(a)
        expected = array(["abc", "def"], dtype=object)

        assert_equal(result, expected)