Ejemplo n.º 1
0
    def test_frame_go_extend_items(self, arrays: tp.Sequence[np.ndarray]) -> None:
        frame_array = arrays[0]
        # just take first columm form 2d arrays
        series_arrays = [a[:, 0] for a in arrays[1:]]

        f1 = FrameGO(frame_array)
        shape = f1.shape

        letters = self.get_letters(len(series_arrays))

        def items() -> tp.Iterator[tp.Tuple[tp.Hashable, Series]]:
            for idx, label in enumerate(letters):
                s = Series(series_arrays[idx], index=f1.index)
                yield label, s

        f1.extend_items(items())

        self.assertEqual(f1.shape[1], shape[1] + len(series_arrays))
Ejemplo n.º 2
0
    def test_store_zip_pickle_c(self) -> None:

        f1 = FrameGO.from_dict(dict(a=(1, 2), b=(3, 4)),
                               index=('x', 'y'),
                               name='foo')

        config = StoreConfig(index_depth=1, include_index=True)
        config_map = StoreConfigMap.from_config(config)

        with temp_file('.zip') as fp:

            st = StoreZipPickle(fp)

            # raise if trying to store a FrameGO
            with self.assertRaises(NotImplementedError):
                st.write(((f1.name, f1), ))
Ejemplo n.º 3
0
 def test_frame_go_extend(self, arrays: tp.Sequence[np.ndarray]) -> None:
     f1 = FrameGO(arrays[0], columns=self.get_letters(arrays[0].shape[1]))
     shape = f1.shape
     f2 = Frame(arrays[1])
     f1.extend(f2)
     self.assertEqual(f1.shape[1], shape[1] + f2.shape[1])