#πŸ”’ Matrix not indexing (again)

7 messages Β· Page 1 of 1 (latest)

upper epoch
#

The functions purpose is to run through the box matrix and find a rand index on the matrix and if the number is zero delete the number, and insert a new number in it, additionally it's supposed to print out the matrix in a 4x4 pattern, it's be printing out in a 1x16

The error that I get is from line 16
The error message is :IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

lofty oxideBOT
#

@upper epoch

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

knotty radish
#

np.delete is probably what you want - test it on its own

you probably should just use box[index] = new_value

blissful spindle
#

@upper epoch Did you check the comment I left on your post before?

#

You are asking the same question again..

lofty oxideBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.