Skip to content
Advertisement

How to find the maximum number in python repeatedly from a group of numbers

I have a numpy array like below:

JavaScript

In this data there are 20 numbers and they are divided in 4 groups with 5 numbers in each group. so for ex.

JavaScript

I want to find out the maximum number from each group and store them in a list. Like:

JavaScript

I am very new to python please help.

Advertisement

Answer

try by splitting 1st then find out the max.

JavaScript

res:

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