Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index error message #12

Open
InOtherWords opened this issue Feb 21, 2022 · 1 comment
Open

Index error message #12

InOtherWords opened this issue Feb 21, 2022 · 1 comment
Assignees
Labels
invalid This doesn't seem right

Comments

@InOtherWords
Copy link

When I run pp_matrix(df, cmap=cmap), I get the following error message:

Traceback (most recent call last):
  File "/Users/name/folder/subfolder/subsubfolder/prepositions.py", line 27, in <module>
    pp_matrix(df, cmap=cmap)
  File "/opt/anaconda3/lib/python3.8/site-packages/pretty_confusion_matrix/pretty_confusion_matrix.py", line 222, in pp_matrix
    txt_res = configcell_text_and_colors(
  File "/opt/anaconda3/lib/python3.8/site-packages/pretty_confusion_matrix/pretty_confusion_matrix.py", line 59, in configcell_text_and_colors
    tot_rig = array_df[col][col]
IndexError: index 37 is out of bounds for axis 0 with size 37

The first few lines of my DateFrame look like this:

                in   auf   mit   zu  ...  an-entlang  auf-entlang  ohne  außerhalb
into          318     8    10    9  ...           0            0     0          0
in           4325   727   681   62  ...           0            0     0          0
on            253  3197   215   46  ...           0            0     0          0
at            206   280    54    9  ...           0            0     0          0
with          384   397  2097   24  ...           0            0     0          0
by             31    12    23    0  ...           0            0     0          0
in-front-of    15    15    25    0  ...           0            0     0          0

The total size is 49 rows x 36 columns.

I think the issue has to do with zero-indexing in Python, but to be honest, I'm not even sure how to go about debugging this.

@wcipriano wcipriano self-assigned this May 13, 2024
@wcipriano
Copy link
Owner

Hello @InOtherWords !
Thank you for your question. Sorry for delay, but I'm in now and I'll support the project !

I can check here in your report that dataframe "total size is 49 rows x 36 columns".
Note that matrix confusion is a type of square data representation, so to print this, you must to provide (input) a square dataset, i.e., the number of the columns and lines must be the same..

If you have more issues, please reporte here and provide your code for me to simulate, okay ?

Best regards !

@wcipriano wcipriano added the invalid This doesn't seem right label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants