diff --git a/forgebox/__init__.py b/forgebox/__init__.py index a070a77..3926618 100644 --- a/forgebox/__init__.py +++ b/forgebox/__init__.py @@ -1 +1 @@ -__version__ = "0.4.18.2" +__version__ = "0.4.18.3" diff --git a/forgebox/multiproc.py b/forgebox/multiproc.py index ae64d6d..e48b74a 100644 --- a/forgebox/multiproc.py +++ b/forgebox/multiproc.py @@ -131,7 +131,7 @@ def __iter__(self): def __getitem__(self, idx): global DataFrameRowling_df - return DataFrameRowling_df[DataFrameRowling_df.index[idx]] + return DataFrameRowling_df[list(DataFrameRowling_df.index[idx]] def __next__(self): global DataFrameRowling_df diff --git a/nbs/09_multiprocess.ipynb b/nbs/09_multiprocess.ipynb index 49ebc19..117a37a 100644 --- a/nbs/09_multiprocess.ipynb +++ b/nbs/09_multiprocess.ipynb @@ -173,7 +173,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 60, "metadata": {}, "outputs": [], "source": [ @@ -204,7 +204,7 @@ " \n", " def __getitem__(self, idx):\n", " global DataFrameRowling_df\n", - " return DataFrameRowling_df[DataFrameRowling_df.index[idx]]\n", + " return DataFrameRowling_df[list(DataFrameRowling_df.index)[idx]]\n", " \n", " def __next__(self):\n", " global DataFrameRowling_df\n", @@ -216,7 +216,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 61, "metadata": {}, "outputs": [], "source": [ @@ -226,13 +226,34 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ "res = Parallel(backend=\"multiprocessing\", n_jobs=6)(delayed(get_line)(i) for i in DataFrameRowling(df))" ] }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "col1 5\n", + "Name: 5, dtype: int64" + ] + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "res[5]" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/settings.ini b/settings.ini index 3baed78..123762d 100644 --- a/settings.ini +++ b/settings.ini @@ -7,7 +7,7 @@ author = xiaochen(ray) zhang author_email = b2ray2c@gmail.com copyright = xiaochen(ray) zhang branch = master -version = 0.4.18.2 +version = 0.4.18.3 min_python = 3.6 audience = Developers language = English