aws / aws/amazon-sagemaker-examples
AttributeError: module 'pandas.core.strings' has no attribute 'StringMethods'
- Dominant language
- Jupyter Notebook
- Stars
- 11k
- Forks
- 7k
- Avg merge
- 8h 29m
- Merged PRs (30d)
- 8
Description
**Link to the notebook**
[xgboost-inference-recommender.](https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-inference-recommender/xgboost/xgboost-inference-recommender.ipynb)
**Describe the bug**
Cell #6 import required libraries fail with the following error
File /opt/conda/lib/python3.10/site-packages/dask/dataframe/accessor.py:276, in StringAccessor()
272 meta = (self._series.name, object)
273 return self._function_map(method, pat=pat, n=n, expand=expand, meta=meta)
275 @derived_from(
--> 276 pd.core.strings.StringMethods,
277 inconsistencies="``expand=True`` with unknown ``n`` will raise a ``NotImplementedError``",
278 )
279 def split(self, pat=None, n=-1, expand=False):
280 """Known inconsistencies: ``expand=True`` with unknown ``n`` will raise a ``NotImplementedError``."""
281 return self._split("split", pat=pat, n=n, expand=expand)
AttributeError: module 'pandas.core.strings' has no attribute 'StringMethods'
**To reproduce**
Execute cell by cell until Cell 6
To fix the issue, run: !pip3 install --upgrade pandas "dask[complete]"
Contributor guide
Research direction
Open sagemaker-inference-recommender/xgboost/xgboost-inference-recommender.ipynb and reproduce the failure by running cells through Cell 6. Check the pandas and dask versions used when importing the required libraries, then verify the notebook’s dependency setup resolves the compatibility error. Done means Cell 6 runs without the StringMethods AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, pandas, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100