Skip to content
Advertisement

How to get the all columns except last column in 3D numpy array?

I Have a 3D array composed of various columns. I just want to slice the last column. The array looks like the following:

JavaScript

I have tried the following code. But it only shows the last column while I want to show all columns values except the last column.

JavaScript

Advertisement

Answer

IUUC, you can use:

JavaScript

Example input:

JavaScript

matching output:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement