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

  • Home
  • SEARCH
  • 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 7816235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:47:46+00:00 2026-06-02T05:47:46+00:00

I just started using Python resp. Rpy2 so I am really a beginner. So

  • 0

I just started using Python resp. Rpy2 so I am really a beginner.
So far I manage to get my own R-package loaded via Rpy2
and a result for my input variables is produced (comparable
to the lm() function of R).
My result is a following:

>>> res
<ListVector - Python:0x1561828 / R:0xe6a5c8>
[Matrix, Array]
  coef.f: <class 'rpy2.robjects.vectors.Matrix'>
  [-10.554713, 1.640681, 0.957045, ..., 0.000000, 0.000000, 0.783108]
  pred.f: <class 'rpy2.robjects.vectors.Array'>
  [17.189366, 7.116058, 41.526062, ..., 459.952946, 312.088634, 677.908581]

I am also able to get the array subpart (pred.f) by using index 1:

>>>res1 = res[1]
>>> res1
<Array - Python:0x1561850 / R:0x4b299d0>
[17.189366, 7.116058, 41.526062, ..., 459.952946, 312.088634, 677.908581]
>>> print res1
, , L=300, AR=1.5, SO=1, T=30

    sigma_stat sigma_mob
fit  17.189366 152.21461
lwr   7.116058  76.98245
upr  41.526062 301.01379

, , L=300, AR=1.5, SO=2, T=30

    sigma_stat sigma_mob
fit   27.62310  284.5423
lwr   14.54639  173.3316
upr   52.45825  467.1449

, , L=300, AR=1.5, SO=3, T=30

    sigma_stat sigma_mob
fit   39.75894  459.9529
lwr   24.07098  312.0886
upr   65.67369  677.9086

Now I’d like to use a intelligent way to access certain numbers in this array.
Eg. I’d like the number for sigma_stat,fit,L=300,AR=1.5,SO=3,T=30 … this means
my array is 6-dimensional.

Is there an easy way to do that? Something like indexing using the dimension names/numbers: res1(‘sigma_stat’,’fit’,’L’=300,’AR’=1.5,’SO’=3,’T’=30)

Thank you for your help…

  • 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-06-02T05:47:48+00:00Added an answer on June 2, 2026 at 5:47 am

    Would something like this work ?

    res1.rx('sigma_stat', 'fit', 'L=300', 'AR=1.5', 'SO=3', 'T=30')
    

    (note that the dimension names must in the right order – I don’t that the time to test, may be ‘sigma_stat’ and ‘fit’ should go to the end of the argument list)

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

Sidebar

Related Questions

I've just started using rpy2 with Python. I've installed it and am able to
I've just started learning about Gimp scripting using Python, and was wondering, how do
I just started using Qt and noticed that it uses its own make tool,
I just started using Pantheios and it feels really like a great library for
I just started with Google App Engine using python and I was following a
I've just started learning python and I'm using MacVim as my editor with the
I've just started using Python and I was thinking about which notation I should
I've just started using Eclipse for Python development since we can make use of
I've been using Python for a long time and I've just started to toy
I have just started using GAE (Python 2.7 SDK 1.6.4) , I have set

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.