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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:43:47+00:00 2026-06-15T10:43:47+00:00

I have a MultiIndex DataFrame that contains these values: AAPL minor 2007-09-14 OC 0.024436

  • 0

I have a MultiIndex DataFrame that contains these values:

                      AAPL
           minor          
2007-09-14 OC     0.024436
2007-09-15 CC     0.030293
           CO     0.017518
           OC     0.024688
           OO     0.031835

# to_dict():

{'AAPL': {(<Timestamp: 2007-09-14 00:00:00>, 'OC'): 0.024436265475779286,
  (<Timestamp: 2007-09-15 00:00:00>, 'CC'): 0.030293017084353703,
  (<Timestamp: 2007-09-15 00:00:00>, 'CO'): 0.017518449703066673,
  (<Timestamp: 2007-09-15 00:00:00>, 'OC'): 0.024688182799779634,
  (<Timestamp: 2007-09-15 00:00:00>, 'OO'): 0.031834725061579666}}

—

and a Series that contains these values:

CC    15.874508
CO    18.590320
OC    30.503468
OO    15.874508

# to_dict():

{'CC': 15.874507866387544,
 'CO': 18.590320061795602,
 'OC': 30.503467646507644,
 'OO': 15.874507866387544}

I’d like to multiply all of the minor index CC values by the CC value in the Series, and the same with the other values. I saw another question on here that gave me the .mul method, but when I try that, even with the level=’minor’, it tells me:

TypeError: can only call with other hierarchical index objects

I’ve unstacked the minor index to make it columns, and specified level=’minor’, axis=’columns’ with the same result.

Finally, the end result is to be able to run this same calculation on a DataFrame where the major columns are several equities — in that instance, would .mul() work against each equity as well?

Thanks for your assistance!

  • 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-15T10:43:48+00:00Added an answer on June 15, 2026 at 10:43 am

    Series based it works with level:

    df["C01"].mul(s, level=1)
    
    major       minor
    2007-09-14  OC       0.745391
    2007-09-15  CC       0.480887
                CO       0.325674
                OC       0.753075
                OO       0.505361
    

    Then you can insert it again into your DataFrame. But that should work with DataFrames too, maybe you can suggest it.

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

Sidebar

Related Questions

I'm programming an agent-based simulation and have decided that Boost's MultiIndex is probably the
I have the following pandas Dataframe: from pandas import DataFrame, MultiIndex index = MultiIndex.from_tuples(zip([21,22,23],[45,45,46]),
I have a MultiIndex container of boost::shared_ptrs to members of class Host . These
I have a Python pandas DataFrame rpt : rpt <class 'pandas.core.frame.DataFrame'> MultiIndex: 47518 entries,
Let's assume I have a DataFrame df with a MultiIndex and it has the
I have a dataframe that looks like this: <class 'pandas.core.frame.DataFrame'> DatetimeIndex: 2016910 entries, 2009-01-02
I have the following Pandas Dataframe with a MultiIndex(Z,A): H1 H2 Z A 0
I have a Tool struct that contains information about a tool retrieved from a
I have a Multindex DataFrame with the following structure: 0 1 2 ref A
I have a Boost.MultiIndex big array about 10Gb. In order to reduce the reading

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.