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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:44:48+00:00 2026-05-23T09:44:48+00:00

The pandas DataFrame object has a sort method but pandas DataMatrix object does not.

  • 0

The pandas DataFrame object has a sort method but pandas DataMatrix object does not.

What is the best way to sort this DataMatrix object by index (the date column) in ascending order?

>>> dm
               compound_ret
2/16/2011 0:00  0.006275682
2/15/2011 0:00  0.003098208
2/14/2011 0:00  0.0055039
2/13/2011 0:00  0.011471506
2/12/2011 0:00  0.011853712
2/11/2011 0:00  0.009558739
2/10/2011 0:00  0.014127912
2/9/2011 0:00   0.02042923
2/8/2011 0:00   0.023308062

The result should be the DataMatrix with 2/8/2011 as the first entry and 2/16/2011 as the last entry. The entries in the compound_ret column should follow their date in the sort. So the result should look something like this:

>>>dm_sorted
                  compound_ret
2/8/2011 0:00    0.023308062
2/9/2011 0:00    0.02042923
2/10/2011 0:00  0.014127912
2/11/2011 0:00  0.009558739
2/12/2011 0:00  0.011853712
2/13/2011 0:00  0.011471506
2/14/2011 0:00  0.0055039
2/15/2011 0:00  0.003098208
2/16/2011 0:00  0.006275682
  • 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-23T09:44:49+00:00Added an answer on May 23, 2026 at 9:44 am

    Indeed between 0.2 and 0.3 I renamed sortUp/sortDown to the single sort methods. Sorry about that.

    I definitely recommend keeping up on the bleeding edge of pandas if you can ( https://github.com/wesm/pandas )! Also, consider using IPython for all your interactive work ( http://ipython.scipy.org )– I find that having tab completion and easy introspection of objects helps a great deal for finding methods and exploring docstrings.

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

Sidebar

Related Questions

This seems really easy, but it's definitely not working as expected. In WPF 4.0,
what is the best way to get parent array key with multidimensional arrays? for
I'm trying to learn panda 3d, but I'm getting this error importerror no module
has anyone included superscripted text in a resource bundle? any advice on this matter
My application uses a large amount of Panda objects. Each Panda has a list
The following FindControl method fails to find the imgAd control. Any idea why? Could
I need to receive a AJAX request value, but alway receive undefined. Panda.Meals.getMealById =
If I go to https://github.com/wesm/pandas and click the Download button to download a zip
I have a rather large tree grid of clients (total tree size 3000 but
Using Objective-C , how can I convert the NSString @Panda's Expenses into this string

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.