prince: IndexingError: Too many indexers

Using example code:

import pandas as pd
import prince

df = pd.read_csv('ogm.csv')
mca = prince.MCA(df, n_components=-1)
mca.plot_rows(show_points=True, show_labels=False, color_by='Position Al A', ellipse_fill=True)

Error:

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    mca.plot_rows(show_points=True, show_labels=False, color_by='Position Al A', ellipse_fill=True)
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/prince/mca.py", line 154, in plot_rows
    ellipse_fill=ellipse_fill
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/prince/plot/mpl/pca.py", line 30, in row_principal_coordinates
    data = principal_coordinates.iloc[:, axes].copy() # Active rows
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py", line 1325, in __getitem__
    return self._getitem_tuple(key)
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py", line 1662, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py", line 189, in _has_valid_tuple
    if not self._has_valid_type(k, i):
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py", line 1599, in _has_valid_type
    return self._is_valid_list_like(key, axis)
  File "/Users/hewgreen/anaconda/lib/python3.6/site-packages/pandas/core/indexing.py", line 1648, in _is_valid_list_like
    raise IndexingError('Too many indexers')
pandas.core.indexing.IndexingError: Too many indexers

I tried to find some details about how to fix myself to no avail. Many thanks in advance for your help.

Regards

hewgreen

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

My apologies. I re-installed the latest and example ran smoothly. Thank you for your quick response. All good. Finally thank you for your great work.