Try to search your question here, if you can't find : Ask Any Question Now ?

how to delete multiple rows in an array

HomeCategory: stackoverflowhow to delete multiple rows in an array
Avatarpragati asked 1 week ago

I have to delete last three rows of the array. It was list but I had to convert it into array so that I can use np.delete function

I tried np.delete function. It deletes column wise instead of row wise.

I want to delete row not column. When I change the axis to 1. it gives an error message of AxisError: axis 1 is out of bounds for array of dimension 1

featureStr2=np.delete(f, slice(3,-1), axis=0). I want to delete last 3 rows. Array looks like below

1 2 3 4 5

6 7 8 9 20

11 23 54 6 7

2 3 4 5 6 7

1 2 3 4 5

Out put of the code is. I want output to delete last 3 rows.

1 Answers
Best Answer
Avatarnaveen answered 1 week ago
Your Answer

15 + 8 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com