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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:11:06+00:00 2026-06-17T20:11:06+00:00

I have a pandas Series with an integer index which I’ve sorted (by value),

  • 0

I have a pandas Series with an integer index which I’ve sorted (by value), how I access values by position in this Series.

For example:

s_original = pd.Series({0: -0.000213, 1: 0.00031399999999999999, 2: -0.00024899999999999998, 3: -2.6999999999999999e-05, 4: 0.000122})
s_sorted = np.sort(s_original)

In [3]: s_original
Out[3]: 
0   -0.000213
1    0.000314
2   -0.000249
3   -0.000027
4    0.000122

In [4]: s_sorted
Out[4]: 
2   -0.000249
0   -0.000213
3   -0.000027
4    0.000122
1    0.000314

In [5]: s_sorted[3]
Out[5]: -2.6999999999999999e-05

But I would like to get the value 0.000122 i.e. the item in position 3.
How can I do this?

  • 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-17T20:11:07+00:00Added an answer on June 17, 2026 at 8:11 pm

    Replace the line

    b = np.sort(a)
    

    with

    b = pd.Series(np.sort(a), index=a.index)
    

    This will sort the values, but keep the index.

    EDIT:

    To get the fourth value in the sorted Series:

    np.sort(a).values[3]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several Pandas Series objects that look like this: r = pd.Series({'a': [1,2,3,4]})
I have some values in a Python Pandas Series (type: pandas.core.series.Series ) In [1]:
I have a pandas Series with values of type datetime64[ns] . The dates are
I have a pandas dataframe consisting of 23 series with a default sequential index
I have a pandas time series data frame. df date is the index. Three
I have a pandas DataFrame with a date column. It is not an index.
I have the data below saved as a pandas dataframe . With this data,
have written this little class, which generates a UUID every time an object of
Say I have two series: a and b, a = Series(None, index=['a','b','c']) b =
I'm trying to merge a series of dataframes in pandas. I have a list

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.