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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:23:36+00:00 2026-06-15T02:23:36+00:00

I have two largish (snippets provided) pandas DateFrame s with unequal dates as indexes

  • 0

I have two largish (snippets provided) pandas DateFrames with unequal dates as indexes that I wish to concat into one:

           NAB.AX                                  CBA.AX
            Close    Volume                         Close    Volume
Date                                    Date
2009-06-05  36.51   4962900             2009-06-08  21.95         0
2009-06-04  36.79   5528800             2009-06-05  21.95   8917000
2009-06-03  36.80   5116500             2009-06-04  22.21  18723600
2009-06-02  36.33   5303700             2009-06-03  23.11  11643800
2009-06-01  36.16   5625500             2009-06-02  22.80  14249900
2009-05-29  35.14  13038600   --AND--   2009-06-01  22.52  11687200
2009-05-28  33.95   7917600             2009-05-29  22.02  22350700
2009-05-27  35.13   4701100             2009-05-28  21.63   9679800
2009-05-26  35.45   4572700             2009-05-27  21.74   9338200
2009-05-25  34.80   3652500             2009-05-26  21.64   8502900

Problem is, if I run this:

keys = ['CBA.AX','NAB.AX']
mv = pandas.concat([data['CBA.AX'][650:660],data['NAB.AX'][650:660]], axis=1, keys=stocks,) 

the following DateFrame is produced:

                                 CBA.AX          NAB.AX        
                              Close  Volume   Close  Volume
Date                                                      
2200-08-16 04:24:21.460041     NaN     NaN     NaN     NaN
2203-05-13 04:24:21.460041     NaN     NaN     NaN     NaN
2206-02-06 04:24:21.460041     NaN     NaN     NaN     NaN
2208-11-02 04:24:21.460041     NaN     NaN     NaN     NaN
2211-07-30 04:24:21.460041     NaN     NaN     NaN     NaN
2219-10-16 04:24:21.460041     NaN     NaN     NaN     NaN
2222-07-12 04:24:21.460041     NaN     NaN     NaN     NaN
2225-04-07 04:24:21.460041     NaN     NaN     NaN     NaN
2228-01-02 04:24:21.460041     NaN     NaN     NaN     NaN
2230-09-28 04:24:21.460041     NaN     NaN     NaN     NaN
2238-12-15 04:24:21.460041     NaN     NaN     NaN     NaN

Does anybody have any idea why this might be the case?

On another point: is there any python libraries around that pull data from yahoo and normalise it?

Cheers.

EDIT: For reference:

data = {
'CBA.AX': <class 'pandas.core.frame.DataFrame'>
    DatetimeIndex: 2313 entries, 2011-12-29 00:00:00 to 2003-01-01 00:00:00
    Data columns:
        Close     2313  non-null values
        Volume    2313  non-null values
    dtypes: float64(1), int64(1),

 'NAB.AX': <class 'pandas.core.frame.DataFrame'>
    DatetimeIndex: 2329 entries, 2011-12-29 00:00:00 to 2003-01-01 00:00:00
    Data columns:
        Close     2329  non-null values
        Volume    2329  non-null values
    dtypes: float64(1), int64(1)
}
  • 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-15T02:23:37+00:00Added an answer on June 15, 2026 at 2:23 am

    It is possible to read the data with pandas and to concatenate it.

    First import the data

    In [449]: import pandas.io.data as web
    
    In [450]: nab = web.get_data_yahoo('NAB.AX', start='2009-05-25',
                                       end='2009-06-05')[['Close', 'Volume']]
    
    In [451]: cba = web.get_data_yahoo('CBA.AX', start='2009-05-26',
                                       end='2009-06-08')[['Close', 'Volume']]
    
    In [453]: nab
    Out[453]: 
                Close    Volume
    Date                       
    2009-05-25  21.15   9685100
    2009-05-26  21.64   8541900
    2009-05-27  21.74   9042900
    2009-05-28  21.63   9701000
    2009-05-29  22.02  14665700
    2009-06-01  22.52   6782000
    2009-06-02  22.80  10473400
    2009-06-03  23.11   9931400
    2009-06-04  22.21  17869000
    2009-06-05  21.95   8214300
    
    In [454]: cba
    Out[454]: 
                Close    Volume
    Date                       
    2009-05-26  35.45   4529600
    2009-05-27  35.13   4521500
    2009-05-28  33.95   7945400
    2009-05-29  35.14  12548500
    2009-06-01  36.16   4509400
    2009-06-02  36.33   4304900
    2009-06-03  36.80   4845400
    2009-06-04  36.79   4592300
    2009-06-05  36.51   4417500
    2009-06-08  36.51         0
    

    Than concatenate it:

    In [455]: keys = ['CBA.AX','NAB.AX']
    
    In [456]: pd.concat([cba, nab], axis=1, keys=keys)
    Out[456]: 
                CBA.AX            NAB.AX          
                 Close    Volume   Close    Volume
    Date                                          
    2009-05-25     NaN       NaN   21.15   9685100
    2009-05-26   35.45   4529600   21.64   8541900
    2009-05-27   35.13   4521500   21.74   9042900
    2009-05-28   33.95   7945400   21.63   9701000
    2009-05-29   35.14  12548500   22.02  14665700
    2009-06-01   36.16   4509400   22.52   6782000
    2009-06-02   36.33   4304900   22.80  10473400
    2009-06-03   36.80   4845400   23.11   9931400
    2009-06-04   36.79   4592300   22.21  17869000
    2009-06-05   36.51   4417500   21.95   8214300
    2009-06-08   36.51         0     NaN       NaN
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two queries that find both the Zip codes, and the States for
I have two date fields that I need to join on. The first is
Have two fields start and end, both are dates, I want to write a
Have two issues one is showFromToolbar statement format warning issue and another is that
I have two XML files. The first XML has a bunch of nodes that
I have two richtextbox's that display stored procedures and its previous version. I would
I have two questions, and should mention I am an Java programmer going into
I have two tables that have the same structure, I need a query to
I have two sentences in python, that are represents sets of words the user
I have two commits that I just pushed to github The 2nd commit message

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.