We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
DEP: Drop `inplace` option of `filter_in`
<!--
Thanks for contributing a pull request!

Please follow these standard acronyms to start the commit message:

- ENH: enhancement
- BUG: bug fix
- DOC: documentation
- TYP: type annotations
- TST: addition or modification of tests
- MAINT: maintenance commit (refactoring, typos, etc.)
- BLD: change related to building
- REL: related to releasing
- API: an (incompatible) API change
- DEP: deprecate something, or remove a deprecated object
- DEV: development tool or utility
- REV: revert an earlier commit
- PERF: performance improvement
- BOT: always commit via a bot
- CI: related to CI or CD
- CLN: Code cleanup
-->

- [x] closes #522
- [ ] whatsnew entry


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dtoolkit/accessor/dataframe/drop_inf.py`
Content:
```
1 from __future__ import annotations
2 
3 from typing import TYPE_CHECKING
4 
5 import numpy as np
6 import pandas as pd
7 from pandas.util._validators import validate_bool_kwarg
8 
9 from dtoolkit.accessor._util import get_inf_range
10 from dtoolkit.accessor.dataframe import boolean  # noqa
11 from dtoolkit.accessor.register import register_dataframe_method
12 
13 
14 if TYPE_CHECKING:
15     from dtoolkit._typing import IntOrStr
16 
17 
18 @register_dataframe_method
19 def drop_inf(
20     df: pd.DataFrame,
21     axis: IntOrStr = 0,
22     how: str = "any",
23     inf: str = "all",
24     subset: list[str] = None,
25     inplace: bool = False,
26 ) -> pd.DataFrame | None:
27     """
28     Remove ``inf`` values.
29 
30     Parameters
31     ----------
32     axis : {0 or 'index', 1 or 'columns'}, default 0
33         Determine if rows or columns which contain ``inf`` values are
34         removed.
35 
36         * 0, or 'index' : Drop rows which contain ``inf`` values.
37         * 1, or 'columns' : Drop columns which contain ``inf`` value.
38 
39     how : {'any', 'all'}, default 'any'
40         Determine if row or column is removed from :obj:`~pandas.DataFrame`,
41         when we have at least one ``inf`` or all ``inf``.
42 
43         * 'any' : If any ``inf`` values are present, drop that row or column.
44         * 'all' : If all values are ``inf``, drop that row or column.
45 
46     inf : {'all', 'pos', 'neg'}, default 'all'
47         * 'all' : Remove ``inf`` and ``-inf``.
48         * 'pos' : Only remove ``inf``.
49         * 'neg' : Only remove ``-inf``.
50 
51     subset : array-like, optional
52         Labels along other axis to consider, e.g. if you are dropping rows
53         these would be a list of columns to include.
54 
55     inplace : bool, default False
56         If True, do operation inplace and return None.
57 
58     Returns
59     -------
60     DataFrame or None
61         DataFrame with ``inf`` entries dropped from it or None if
62         ``inplace=True``.
63 
64     See Also
65     --------
66     dtoolkit.accessor.series.drop_inf
67         :obj:`~pandas.Series` drops ``inf`` values.
68 
69     Examples
70     --------
71     >>> import dtoolkit.accessor
72     >>> import pandas as pd
73     >>> import numpy as np
74     >>> df = pd.DataFrame({"name": ['Alfred', 'Batman', 'Catwoman'],
75     ...                    "toy": [np.inf, 'Batmobile', 'Bullwhip'],
76     ...                    "born": [np.inf, pd.Timestamp("1940-04-25"),
77     ...                             -np.inf]})
78     >>> df
79            name        toy                 born
80     0    Alfred        inf                  inf
81     1    Batman  Batmobile  1940-04-25 00:00:00
82     2  Catwoman   Bullwhip                 -inf
83 
84     Drop the rows where at least one element is inf and -inf.
85 
86     >>> df.drop_inf()
87          name        toy                 born
88     1  Batman  Batmobile  1940-04-25 00:00:00
89 
90     Drop the columns where at least one element is inf and -inf.
91 
92     >>> df.drop_inf(axis='columns')
93            name
94     0    Alfred
95     1    Batman
96     2  Catwoman
97 
98     Drop the rows where all elements are inf and -inf.
99 
100     >>> df.drop_inf(how='all')
101            name        toy                 born
102     0    Alfred        inf                  inf
103     1    Batman  Batmobile  1940-04-25 00:00:00
104     2  Catwoman   Bullwhip                 -inf
105 
106     Drop the rows where at least one element is -inf.
107 
108     >>> df.drop_inf(inf='neg')
109            name        toy                 born
110     0    Alfred        inf                  inf
111     1    Batman  Batmobile  1940-04-25 00:00:00
112 
113     Define in which columns to look for inf and -inf values.
114 
115     >>> df.drop_inf(subset=['name', 'toy'])
116            name        toy                 born
117     1    Batman  Batmobile  1940-04-25 00:00:00
118     2  Catwoman   Bullwhip                 -inf
119 
120     Keep the DataFrame with valid entries in the same variable.
121 
122     >>> df.drop_inf(inplace=True)
123     >>> df
124            name        toy                 born
125     1    Batman  Batmobile  1940-04-25 00:00:00
126     """
127 
128     inplace = validate_bool_kwarg(inplace, "inplace")
129 
130     axis = df._get_axis_number(axis)
131     agg_axis = 1 - axis
132 
133     agg_obj = df
134     if subset is not None:
135         ax = df._get_axis(agg_axis)
136         indices = ax.get_indexer_for(subset)
137         check = indices == -1
138         if check.any():
139             raise KeyError(list(np.compress(check, subset)))
140 
141         agg_obj = df.take(indices, axis=agg_axis)
142 
143     inf_range = get_inf_range(inf)
144     mask = agg_obj.isin(inf_range).boolean(how=how, axis=agg_axis)
145     result = df.loc(axis=axis)[~mask]
146 
147     if not inplace:
148         return result
149 
150     df._update_inplace(result)
151
```

Path: `dtoolkit/accessor/series/drop_inf.py`
Content:
```
1 from __future__ import annotations
2 
3 import pandas as pd
4 from pandas.util._validators import validate_bool_kwarg
5 
6 from dtoolkit.accessor._util import get_inf_range
7 from dtoolkit.accessor.register import register_series_method
8 
9 
10 @register_series_method
11 def drop_inf(
12     s: pd.Series,
13     inf: str = "all",
14     inplace: bool = False,
15 ) -> pd.Series | None:
16     """
17     Remove ``inf`` values.
18 
19     Parameters
20     ----------
21     inf : {'all', 'pos', 'neg'}, default 'all'
22 
23         * 'all' : Remove ``inf`` and ``-inf``.
24         * 'pos' : Only remove ``inf``.
25         * 'neg' : Only remove ``-inf``.
26 
27     inplace : bool, default False
28         If True, do operation inplace and return None.
29 
30     Returns
31     -------
32     Series or None
33         Series with ``inf`` entries dropped from it or None if
34         ``inplace=True``.
35 
36     See Also
37     --------
38     dtoolkit.accessor.dataframe.drop_inf
39         :obj:`~pandas.DataFrame` drops rows or columns which contain ``inf``
40         values.
41 
42     Examples
43     --------
44     >>> import dtoolkit.accessor
45     >>> import pandas as pd
46     >>> import numpy as np
47     >>> s = pd.Series([1., 2., np.inf])
48     >>> s
49     0    1.0
50     1    2.0
51     2    inf
52     dtype: float64
53 
54     Drop inf values from a Series.
55 
56     >>> s.drop_inf()
57     0    1.0
58     1    2.0
59     dtype: float64
60 
61     Keep the Series with valid entries in the same variable.
62 
63     >>> s.drop_inf(inplace=True)
64     >>> s
65     0    1.0
66     1    2.0
67     dtype: float64
68     """
69 
70     inplace = validate_bool_kwarg(inplace, "inplace")
71     inf_range = get_inf_range(inf)
72     mask = s.isin(inf_range)
73     result = s[~mask]
74 
75     if not inplace:
76         return result
77 
78     s._update_inplace(result)
79
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/dtoolkit/accessor/dataframe/drop_inf.py b/dtoolkit/accessor/dataframe/drop_inf.py
--- a/dtoolkit/accessor/dataframe/drop_inf.py
+++ b/dtoolkit/accessor/dataframe/drop_inf.py
@@ -9,6 +9,7 @@
 from dtoolkit.accessor._util import get_inf_range
 from dtoolkit.accessor.dataframe import boolean  # noqa
 from dtoolkit.accessor.register import register_dataframe_method
+from dtoolkit.util._decorator import deprecated_kwargs
 
 
 if TYPE_CHECKING:
@@ -16,6 +17,13 @@
 
 
 @register_dataframe_method
+@deprecated_kwargs(
+    "inplace",
+    message=(
+        "The keyword argument '{argument}' of '{func_name}' is deprecated and will "
+        "be removed in 0.0.17. (Warning added DToolKit 0.0.16)"
+    ),
+)
 def drop_inf(
     df: pd.DataFrame,
     axis: IntOrStr = 0,
diff --git a/dtoolkit/accessor/series/drop_inf.py b/dtoolkit/accessor/series/drop_inf.py
--- a/dtoolkit/accessor/series/drop_inf.py
+++ b/dtoolkit/accessor/series/drop_inf.py
@@ -5,9 +5,17 @@
 
 from dtoolkit.accessor._util import get_inf_range
 from dtoolkit.accessor.register import register_series_method
+from dtoolkit.util._decorator import deprecated_kwargs
 
 
 @register_series_method
+@deprecated_kwargs(
+    "inplace",
+    message=(
+        "The keyword argument '{argument}' of '{func_name}' is deprecated and will "
+        "be removed in 0.0.17. (Warning added DToolKit 0.0.16)"
+    ),
+)
 def drop_inf(
     s: pd.Series,
     inf: str = "all",

{"golden_diff": "diff --git a/dtoolkit/accessor/dataframe/drop_inf.py b/dtoolkit/accessor/dataframe/drop_inf.py\n--- a/dtoolkit/accessor/dataframe/drop_inf.py\n+++ b/dtoolkit/accessor/dataframe/drop_inf.py\n@@ -9,6 +9,7 @@\n from dtoolkit.accessor._util import get_inf_range\n from dtoolkit.accessor.dataframe import boolean  # noqa\n from dtoolkit.accessor.register import register_dataframe_method\n+from dtoolkit.util._decorator import deprecated_kwargs\n \n \n if TYPE_CHECKING:\n@@ -16,6 +17,13 @@\n \n \n @register_dataframe_method\n+@deprecated_kwargs(\n+    \"inplace\",\n+    message=(\n+        \"The keyword argument '{argument}' of '{func_name}' is deprecated and will \"\n+        \"be removed in 0.0.17. (Warning added DToolKit 0.0.16)\"\n+    ),\n+)\n def drop_inf(\n     df: pd.DataFrame,\n     axis: IntOrStr = 0,\ndiff --git a/dtoolkit/accessor/series/drop_inf.py b/dtoolkit/accessor/series/drop_inf.py\n--- a/dtoolkit/accessor/series/drop_inf.py\n+++ b/dtoolkit/accessor/series/drop_inf.py\n@@ -5,9 +5,17 @@\n \n from dtoolkit.accessor._util import get_inf_range\n from dtoolkit.accessor.register import register_series_method\n+from dtoolkit.util._decorator import deprecated_kwargs\n \n \n @register_series_method\n+@deprecated_kwargs(\n+    \"inplace\",\n+    message=(\n+        \"The keyword argument '{argument}' of '{func_name}' is deprecated and will \"\n+        \"be removed in 0.0.17. (Warning added DToolKit 0.0.16)\"\n+    ),\n+)\n def drop_inf(\n     s: pd.Series,\n     inf: str = \"all\",\n", "issue": "DEP: Drop `inplace` option of `filter_in`\n<!--\r\nThanks for contributing a pull request!\r\n\r\nPlease follow these standard acronyms to start the commit message:\r\n\r\n- ENH: enhancement\r\n- BUG: bug fix\r\n- DOC: documentation\r\n- TYP: type annotations\r\n- TST: addition or modification of tests\r\n- MAINT: maintenance commit (refactoring, typos, etc.)\r\n- BLD: change related to building\r\n- REL: related to releasing\r\n- API: an (incompatible) API change\r\n- DEP: deprecate something, or remove a deprecated object\r\n- DEV: development tool or utility\r\n- REV: revert an earlier commit\r\n- PERF: performance improvement\r\n- BOT: always commit via a bot\r\n- CI: related to CI or CD\r\n- CLN: Code cleanup\r\n-->\r\n\r\n- [x] closes #522\r\n- [ ] whatsnew entry\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.util._validators import validate_bool_kwarg\n\nfrom dtoolkit.accessor._util import get_inf_range\nfrom dtoolkit.accessor.dataframe import boolean  # noqa\nfrom dtoolkit.accessor.register import register_dataframe_method\n\n\nif TYPE_CHECKING:\n    from dtoolkit._typing import IntOrStr\n\n\n@register_dataframe_method\ndef drop_inf(\n    df: pd.DataFrame,\n    axis: IntOrStr = 0,\n    how: str = \"any\",\n    inf: str = \"all\",\n    subset: list[str] = None,\n    inplace: bool = False,\n) -> pd.DataFrame | None:\n    \"\"\"\n    Remove ``inf`` values.\n\n    Parameters\n    ----------\n    axis : {0 or 'index', 1 or 'columns'}, default 0\n        Determine if rows or columns which contain ``inf`` values are\n        removed.\n\n        * 0, or 'index' : Drop rows which contain ``inf`` values.\n        * 1, or 'columns' : Drop columns which contain ``inf`` value.\n\n    how : {'any', 'all'}, default 'any'\n        Determine if row or column is removed from :obj:`~pandas.DataFrame`,\n        when we have at least one ``inf`` or all ``inf``.\n\n        * 'any' : If any ``inf`` values are present, drop that row or column.\n        * 'all' : If all values are ``inf``, drop that row or column.\n\n    inf : {'all', 'pos', 'neg'}, default 'all'\n        * 'all' : Remove ``inf`` and ``-inf``.\n        * 'pos' : Only remove ``inf``.\n        * 'neg' : Only remove ``-inf``.\n\n    subset : array-like, optional\n        Labels along other axis to consider, e.g. if you are dropping rows\n        these would be a list of columns to include.\n\n    inplace : bool, default False\n        If True, do operation inplace and return None.\n\n    Returns\n    -------\n    DataFrame or None\n        DataFrame with ``inf`` entries dropped from it or None if\n        ``inplace=True``.\n\n    See Also\n    --------\n    dtoolkit.accessor.series.drop_inf\n        :obj:`~pandas.Series` drops ``inf`` values.\n\n    Examples\n    --------\n    >>> import dtoolkit.accessor\n    >>> import pandas as pd\n    >>> import numpy as np\n    >>> df = pd.DataFrame({\"name\": ['Alfred', 'Batman', 'Catwoman'],\n    ...                    \"toy\": [np.inf, 'Batmobile', 'Bullwhip'],\n    ...                    \"born\": [np.inf, pd.Timestamp(\"1940-04-25\"),\n    ...                             -np.inf]})\n    >>> df\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Drop the rows where at least one element is inf and -inf.\n\n    >>> df.drop_inf()\n         name        toy                 born\n    1  Batman  Batmobile  1940-04-25 00:00:00\n\n    Drop the columns where at least one element is inf and -inf.\n\n    >>> df.drop_inf(axis='columns')\n           name\n    0    Alfred\n    1    Batman\n    2  Catwoman\n\n    Drop the rows where all elements are inf and -inf.\n\n    >>> df.drop_inf(how='all')\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Drop the rows where at least one element is -inf.\n\n    >>> df.drop_inf(inf='neg')\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n\n    Define in which columns to look for inf and -inf values.\n\n    >>> df.drop_inf(subset=['name', 'toy'])\n           name        toy                 born\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Keep the DataFrame with valid entries in the same variable.\n\n    >>> df.drop_inf(inplace=True)\n    >>> df\n           name        toy                 born\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    \"\"\"\n\n    inplace = validate_bool_kwarg(inplace, \"inplace\")\n\n    axis = df._get_axis_number(axis)\n    agg_axis = 1 - axis\n\n    agg_obj = df\n    if subset is not None:\n        ax = df._get_axis(agg_axis)\n        indices = ax.get_indexer_for(subset)\n        check = indices == -1\n        if check.any():\n            raise KeyError(list(np.compress(check, subset)))\n\n        agg_obj = df.take(indices, axis=agg_axis)\n\n    inf_range = get_inf_range(inf)\n    mask = agg_obj.isin(inf_range).boolean(how=how, axis=agg_axis)\n    result = df.loc(axis=axis)[~mask]\n\n    if not inplace:\n        return result\n\n    df._update_inplace(result)\n", "path": "dtoolkit/accessor/dataframe/drop_inf.py"}, {"content": "from __future__ import annotations\n\nimport pandas as pd\nfrom pandas.util._validators import validate_bool_kwarg\n\nfrom dtoolkit.accessor._util import get_inf_range\nfrom dtoolkit.accessor.register import register_series_method\n\n\n@register_series_method\ndef drop_inf(\n    s: pd.Series,\n    inf: str = \"all\",\n    inplace: bool = False,\n) -> pd.Series | None:\n    \"\"\"\n    Remove ``inf`` values.\n\n    Parameters\n    ----------\n    inf : {'all', 'pos', 'neg'}, default 'all'\n\n        * 'all' : Remove ``inf`` and ``-inf``.\n        * 'pos' : Only remove ``inf``.\n        * 'neg' : Only remove ``-inf``.\n\n    inplace : bool, default False\n        If True, do operation inplace and return None.\n\n    Returns\n    -------\n    Series or None\n        Series with ``inf`` entries dropped from it or None if\n        ``inplace=True``.\n\n    See Also\n    --------\n    dtoolkit.accessor.dataframe.drop_inf\n        :obj:`~pandas.DataFrame` drops rows or columns which contain ``inf``\n        values.\n\n    Examples\n    --------\n    >>> import dtoolkit.accessor\n    >>> import pandas as pd\n    >>> import numpy as np\n    >>> s = pd.Series([1., 2., np.inf])\n    >>> s\n    0    1.0\n    1    2.0\n    2    inf\n    dtype: float64\n\n    Drop inf values from a Series.\n\n    >>> s.drop_inf()\n    0    1.0\n    1    2.0\n    dtype: float64\n\n    Keep the Series with valid entries in the same variable.\n\n    >>> s.drop_inf(inplace=True)\n    >>> s\n    0    1.0\n    1    2.0\n    dtype: float64\n    \"\"\"\n\n    inplace = validate_bool_kwarg(inplace, \"inplace\")\n    inf_range = get_inf_range(inf)\n    mask = s.isin(inf_range)\n    result = s[~mask]\n\n    if not inplace:\n        return result\n\n    s._update_inplace(result)\n", "path": "dtoolkit/accessor/series/drop_inf.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.util._validators import validate_bool_kwarg\n\nfrom dtoolkit.accessor._util import get_inf_range\nfrom dtoolkit.accessor.dataframe import boolean  # noqa\nfrom dtoolkit.accessor.register import register_dataframe_method\nfrom dtoolkit.util._decorator import deprecated_kwargs\n\n\nif TYPE_CHECKING:\n    from dtoolkit._typing import IntOrStr\n\n\n@register_dataframe_method\n@deprecated_kwargs(\n    \"inplace\",\n    message=(\n        \"The keyword argument '{argument}' of '{func_name}' is deprecated and will \"\n        \"be removed in 0.0.17. (Warning added DToolKit 0.0.16)\"\n    ),\n)\ndef drop_inf(\n    df: pd.DataFrame,\n    axis: IntOrStr = 0,\n    how: str = \"any\",\n    inf: str = \"all\",\n    subset: list[str] = None,\n    inplace: bool = False,\n) -> pd.DataFrame | None:\n    \"\"\"\n    Remove ``inf`` values.\n\n    Parameters\n    ----------\n    axis : {0 or 'index', 1 or 'columns'}, default 0\n        Determine if rows or columns which contain ``inf`` values are\n        removed.\n\n        * 0, or 'index' : Drop rows which contain ``inf`` values.\n        * 1, or 'columns' : Drop columns which contain ``inf`` value.\n\n    how : {'any', 'all'}, default 'any'\n        Determine if row or column is removed from :obj:`~pandas.DataFrame`,\n        when we have at least one ``inf`` or all ``inf``.\n\n        * 'any' : If any ``inf`` values are present, drop that row or column.\n        * 'all' : If all values are ``inf``, drop that row or column.\n\n    inf : {'all', 'pos', 'neg'}, default 'all'\n        * 'all' : Remove ``inf`` and ``-inf``.\n        * 'pos' : Only remove ``inf``.\n        * 'neg' : Only remove ``-inf``.\n\n    subset : array-like, optional\n        Labels along other axis to consider, e.g. if you are dropping rows\n        these would be a list of columns to include.\n\n    inplace : bool, default False\n        If True, do operation inplace and return None.\n\n    Returns\n    -------\n    DataFrame or None\n        DataFrame with ``inf`` entries dropped from it or None if\n        ``inplace=True``.\n\n    See Also\n    --------\n    dtoolkit.accessor.series.drop_inf\n        :obj:`~pandas.Series` drops ``inf`` values.\n\n    Examples\n    --------\n    >>> import dtoolkit.accessor\n    >>> import pandas as pd\n    >>> import numpy as np\n    >>> df = pd.DataFrame({\"name\": ['Alfred', 'Batman', 'Catwoman'],\n    ...                    \"toy\": [np.inf, 'Batmobile', 'Bullwhip'],\n    ...                    \"born\": [np.inf, pd.Timestamp(\"1940-04-25\"),\n    ...                             -np.inf]})\n    >>> df\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Drop the rows where at least one element is inf and -inf.\n\n    >>> df.drop_inf()\n         name        toy                 born\n    1  Batman  Batmobile  1940-04-25 00:00:00\n\n    Drop the columns where at least one element is inf and -inf.\n\n    >>> df.drop_inf(axis='columns')\n           name\n    0    Alfred\n    1    Batman\n    2  Catwoman\n\n    Drop the rows where all elements are inf and -inf.\n\n    >>> df.drop_inf(how='all')\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Drop the rows where at least one element is -inf.\n\n    >>> df.drop_inf(inf='neg')\n           name        toy                 born\n    0    Alfred        inf                  inf\n    1    Batman  Batmobile  1940-04-25 00:00:00\n\n    Define in which columns to look for inf and -inf values.\n\n    >>> df.drop_inf(subset=['name', 'toy'])\n           name        toy                 born\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    2  Catwoman   Bullwhip                 -inf\n\n    Keep the DataFrame with valid entries in the same variable.\n\n    >>> df.drop_inf(inplace=True)\n    >>> df\n           name        toy                 born\n    1    Batman  Batmobile  1940-04-25 00:00:00\n    \"\"\"\n\n    inplace = validate_bool_kwarg(inplace, \"inplace\")\n\n    axis = df._get_axis_number(axis)\n    agg_axis = 1 - axis\n\n    agg_obj = df\n    if subset is not None:\n        ax = df._get_axis(agg_axis)\n        indices = ax.get_indexer_for(subset)\n        check = indices == -1\n        if check.any():\n            raise KeyError(list(np.compress(check, subset)))\n\n        agg_obj = df.take(indices, axis=agg_axis)\n\n    inf_range = get_inf_range(inf)\n    mask = agg_obj.isin(inf_range).boolean(how=how, axis=agg_axis)\n    result = df.loc(axis=axis)[~mask]\n\n    if not inplace:\n        return result\n\n    df._update_inplace(result)\n", "path": "dtoolkit/accessor/dataframe/drop_inf.py"}, {"content": "from __future__ import annotations\n\nimport pandas as pd\nfrom pandas.util._validators import validate_bool_kwarg\n\nfrom dtoolkit.accessor._util import get_inf_range\nfrom dtoolkit.accessor.register import register_series_method\nfrom dtoolkit.util._decorator import deprecated_kwargs\n\n\n@register_series_method\n@deprecated_kwargs(\n    \"inplace\",\n    message=(\n        \"The keyword argument '{argument}' of '{func_name}' is deprecated and will \"\n        \"be removed in 0.0.17. (Warning added DToolKit 0.0.16)\"\n    ),\n)\ndef drop_inf(\n    s: pd.Series,\n    inf: str = \"all\",\n    inplace: bool = False,\n) -> pd.Series | None:\n    \"\"\"\n    Remove ``inf`` values.\n\n    Parameters\n    ----------\n    inf : {'all', 'pos', 'neg'}, default 'all'\n\n        * 'all' : Remove ``inf`` and ``-inf``.\n        * 'pos' : Only remove ``inf``.\n        * 'neg' : Only remove ``-inf``.\n\n    inplace : bool, default False\n        If True, do operation inplace and return None.\n\n    Returns\n    -------\n    Series or None\n        Series with ``inf`` entries dropped from it or None if\n        ``inplace=True``.\n\n    See Also\n    --------\n    dtoolkit.accessor.dataframe.drop_inf\n        :obj:`~pandas.DataFrame` drops rows or columns which contain ``inf``\n        values.\n\n    Examples\n    --------\n    >>> import dtoolkit.accessor\n    >>> import pandas as pd\n    >>> import numpy as np\n    >>> s = pd.Series([1., 2., np.inf])\n    >>> s\n    0    1.0\n    1    2.0\n    2    inf\n    dtype: float64\n\n    Drop inf values from a Series.\n\n    >>> s.drop_inf()\n    0    1.0\n    1    2.0\n    dtype: float64\n\n    Keep the Series with valid entries in the same variable.\n\n    >>> s.drop_inf(inplace=True)\n    >>> s\n    0    1.0\n    1    2.0\n    dtype: float64\n    \"\"\"\n\n    inplace = validate_bool_kwarg(inplace, \"inplace\")\n    inf_range = get_inf_range(inf)\n    mask = s.isin(inf_range)\n    result = s[~mask]\n\n    if not inplace:\n        return result\n\n    s._update_inplace(result)\n", "path": "dtoolkit/accessor/series/drop_inf.py"}]}