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 6609437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:43:04+00:00 2026-05-25T19:43:04+00:00

Numpy can manipulate matrix. And matrix element can be got via numerical indexes. Now,

  • 0

Numpy can manipulate matrix. And matrix element can be got via numerical indexes.

Now, say I have a 3*3 square matrix M
(Actually, it is a Malcov transition matrix, where each element speaks the probability from one state switching to another).

And the row and column both represent rain, snow, niceday in order.

[0.5 ,0.25,0.25
 1   , 0  , 0
 0.25,0.25,0.5]

Ordinarily, if I want to get the (rain,snow) element, I would have to write M[0,1].

But I think this is not readable enough.

So I wonder if I can get such element M[‘rain’,’snow’], if I have defined such dict-like matrix before(if it is allowed numpy matrix manipulation rule)

  • 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-25T19:43:04+00:00Added an answer on May 25, 2026 at 7:43 pm

    You can set the variables rain, snow and niceday and use this variables instead the numbers

    rain = 0
    snow = 1
    M[rain, snow]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about numpy.matrix class. How can I perform such basic manipulations
How can I run hierarchical clustering on a correlation matrix in scipy / numpy
I use numpy for numerical linear algebra. I suspect that I can get much
Given an NxM feature vectors as numpy matrix. Is there any routine that can
How can I convert an ndarray to a matrix in numpy? I'm trying to
I have a two-dimensional numpy array(uint16), how can I truncate all values above a
One can use numpy 's extract function to match an element in an array.
with numpy arrays, you can use some kind of inequality within the square bracket
In numpy/scipy I have an image stored in an array. I can display it,
I have the following array in NumPy: A = array([1, 2, 3]) How can

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.