question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: type object 'NDFrame' has no attribute 'groupby'

See original GitHub issue

AttributeError: type object ‘NDFrame’ has no attribute ‘groupby’

from pandas_ml import ConfusionMatrix cm = ConfusionMatrix(actu, pred) cm.print_stats()


AttributeError Traceback (most recent call last) <ipython-input-41-821e4723af64> in <module> ----> 1 from pandas_ml import confusion_matrix 2 3 cm = ConfusionMatrix(actu, pred) 4 cm.print_stats()

/usr/local/lib/python3.8/site-packages/pandas_ml/init.py in <module> 1 #!/usr/bin/env python 2 ----> 3 from pandas_ml.core import ModelFrame, ModelSeries # noqa 4 from pandas_ml.tools import info # noqa 5 from pandas_ml.version import version as version # noqa

/usr/local/lib/python3.8/site-packages/pandas_ml/core/init.py in <module> 1 #!/usr/bin/env python 2 ----> 3 from pandas_ml.core.frame import ModelFrame # noqa 4 from pandas_ml.core.series import ModelSeries # noqa

/usr/local/lib/python3.8/site-packages/pandas_ml/core/frame.py in <module> 16 from pandas_ml.core.accessor import _AccessorMethods 17 from pandas_ml.core.generic import ModelPredictor, _shared_docs —> 18 from pandas_ml.core.series import ModelSeries 19 20

/usr/local/lib/python3.8/site-packages/pandas_ml/core/series.py in <module> 9 10 —> 11 class ModelSeries(ModelTransformer, pd.Series): 12 “”" 13 Wrapper for pandas.Series to support sklearn.preprocessing

/usr/local/lib/python3.8/site-packages/pandas_ml/core/series.py in ModelSeries() 78 return df 79 —> 80 @Appender(pd.core.generic.NDFrame.groupby.doc) 81 def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True, 82 group_keys=True, squeeze=False):

AttributeError: type object ‘NDFrame’ has no attribute ‘groupby’

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
elcoliecommented, Dec 24, 2020

Workaround. I put constraint like this and run with python3.7

pandas==0.24.2
pandas-ml
scikit-learn==0.20.0
1reaction
alexjuliencommented, Dec 23, 2020

Same here, from the first import pandas_ml as pdml in a fresh pipenv with only pandas and pandas-ml

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'list' object has no attribute 'groupby' - Stack ...
I want to improve my previous cod so that the three Pies can be drawn at once. <class 'str'> data = a.groupby(i)['income'].sum() AttributeError: ......
Read more >
AttributeError type object DataFrame has no attribute from items
Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'. Try this: data=pd.read_csv('/your file name', ...
Read more >
'DataFrame' object has no attribute 'group_by' - Reddit
I'm trying to group some data in a dataframe and getting this error. The steps I've taken are: in a for loop: read...
Read more >
Source code for pandas.core.groupby
_selection = selection if isinstance(obj, NDFrame): obj. ... _make_wrapper(attr) raise AttributeError("%r object has no attribute %r" % (type(self).
Read more >
pandas.DataFrame — pandas 0.19.2 documentation
Return the dtypes in this object. empty, True if NDFrame is entirely empty [no items], meaning any of the axes are of length...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found