Skip to content

Update Sweep.py#12

Open
UmerFarooqBiomedical wants to merge 1 commit intokai5z:masterfrom
UmerFarooqBiomedical:patch-1
Open

Update Sweep.py#12
UmerFarooqBiomedical wants to merge 1 commit intokai5z:masterfrom
UmerFarooqBiomedical:patch-1

Conversation

@UmerFarooqBiomedical
Copy link
Copy Markdown

There is this error while running your code:

Element k- and m-matrix symbolic evaluation done
Element k- and m-matrix numeric evaluation done
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/fromnumeric.py:86: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. return ufunc.reduce(obj, axis, dtype, out, **passkwargs) Global K- and M-matrix addition done
Traceback (most recent call last):
File "/Users/Umer/Desktop/OpenAI code/CYMATICS/chladni_patterns.py", line 141, in F = np.delete(F, ix, axis=1)
File "<array_function internals>", line 180, in delete File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/lib/function_base.py", line 5128, in delete keep[obj,] = False
IndexError: index 1441 is out of bounds for axis 0 with size 1

----- Solution -------

The error message suggests that the index 1441 is out of bounds for axis 0 with size 1. This means that you are trying to access an element at index 1441 along the first axis of an array that has only 1 element along that axis.

In this code case, the array F has shape (2881, 1), which means it has 2881 elements along the first axis and 1 element along the second axis. When you try to delete columns with indices 1441 and 1442 using the code F = np.delete(F, ix, axis=1), you are trying to delete columns that don't exist, because the array has only one column. You can use print(F.shape()) command to check the shape of F array.

To fix the error, you should make sure that the indices you pass to np.delete are valid for the shape of the array. For example, if you want to delete the first column, you can use F = np.delete(F, 0, axis=1). If you want to delete the last two columns, you can use F = np.delete(F, np.s_[-2:], axis=1)

In this code case, you can simply remove this code line or use try and except method to make it run properly. (Reference: Line 145-148)

There is this error with your code:

Element k- and m-matrix symbolic evaluation done
Element k- and m-matrix numeric evaluation done
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/fromnumeric.py:86: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
Global K- and M-matrix addition done
Traceback (most recent call last):
File "/Users/walkerhutchinson/Desktop/OpenAI code/CYMATICS/chladni_patterns.py", line 141, in
F = np.delete(F, ix, axis=1)
File "<array_function internals>", line 180, in delete
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/lib/function_base.py", line 5128, in delete
keep[obj,] = False
IndexError: index 1441 is out of bounds for axis 0 with size 1

----- Solution -------

The error message suggests that the index 1441 is out of bounds for axis 0 with size 1. This means that you are trying to access an element at index 1441 along the first axis of an array that has only 1 element along that axis.

In this code case, the array F has shape (2881, 1), which means it has 2881 elements along the first axis and 1 element along the second axis. When you try to delete columns with indices 1441 and 1442 using the code F = np.delete(F, ix, axis=1), you are trying to delete columns that don't exist, because the array has only one column. You can use print(F.shape()) command to check the shape of F array.

To fix the error, you should make sure that the indices you pass to np.delete are valid for the shape of the array. For example, if you want to delete the first column, you can use F = np.delete(F, 0, axis=1). If you want to delete the last two columns, you can use F = np.delete(F, np.s_[-2:], axis=1)

In this code case, you can simply remove this code line or use try and except method to make it run properly. (Reference: Line 145-148)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant