IndexingError: Too many indexers
See original GitHub issueUsing 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
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
"Too many indexers" with DataFrame.loc - Stack Overflow
Pandas gets confused sometimes when indexes are similar or contain similar values. If you were to have a column named 'C1' or something...
Read more >Wrong "Too many indexers" error message when ... - GitHub
I don't think this should ever raise a "IndexingError: Too many indexers" as you actually have a length 2 indexer (so suits the...
Read more >pandas.core.indexing.IndexingError: Too many ... - YouTube
Pandas : pandas.core.indexing. IndexingError : Too many indexers [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Pandas ...
Read more >pandas.errors.IndexingError — pandas 1.5.2 documentation
IndexingError : Too many indexers >>> df[pd.Series([True], dtype=bool)] ... # IndexingError: Unalignable boolean Series provided as indexer... >>> s = pd.
Read more >pandas.core.indexing.IndexingError: Too many indexers-pandas
django. My goal is to take out the numerical value but I do not know how to set the index properly. What I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@Sunil4423 There is an error in your code on line 2 - not in prince. Re-investigate your stack trace.