Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:07:40+00:00 2026-05-27T21:07:40+00:00

below is the code to create multiple sets of 0’s and fill it with

  • 0

below is the code to create multiple sets of 0’s and fill it with random numbers, im then taking the first column and calculating the maximum value, the problem is I need to be able to do this for every row (i.e rows 2 through 10)
ive tried putting it into a for loop however it doesnt work with the traditional y=1, mx[:,y], y = y+1

can anyone offer some help? cheers

import pylab

mx = pylab.zeros ((10,6))

for j in range(0,10):
    mx[j] = pylab.randn()

p = mx[:,1]
a = max (p)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:07:41+00:00Added an answer on May 27, 2026 at 9:07 pm

    If you are looking for the max of rows 2 through 10,
    then use mx.max(axis=1) to find the max of all rows, and then slice it down to just rows 2 through 10:

    mx.max(axis=1)[2:]
    

    For example, if

    In [38]: mx = np.arange(60).reshape((10, 6))
    
    In [39]: mx
    Out[39]: 
    array([[ 0,  1,  2,  3,  4,  5],
           [ 6,  7,  8,  9, 10, 11],
           [12, 13, 14, 15, 16, 17],
           [18, 19, 20, 21, 22, 23],
           [24, 25, 26, 27, 28, 29],
           [30, 31, 32, 33, 34, 35],
           [36, 37, 38, 39, 40, 41],
           [42, 43, 44, 45, 46, 47],
           [48, 49, 50, 51, 52, 53],
           [54, 55, 56, 57, 58, 59]])
    

    Then

    In [40]: mx.max(axis=1)[2:]
    Out[40]: array([17, 23, 29, 35, 41, 47, 53, 59])
    

    Finally, as larsman has already shown, you can use mx = np.random.randn(10, 6)
    to make the random matrix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create multiple styles in the Window.Resources. Below is the code I
I am using below code to create a reminder in Google calendar (using Google
Below is sample code to create a radio button element with Yes/No options in
Greetings, The VBA code below will create an Excel QueryTable object and display it
the code below gives compilation error when I try to create test t[2]; because
Given the code below, how would you create/implement SR.h so that it produces the
I am using jquery to create a custom dropdown with the code below. I
I'm trying to create a custom drop down and using the code below it
Can anyone tell how correct the following code below. Iam tryin to create a
I am trying to create a new db called testDB2, below is my code.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.