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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:01:17+00:00 2026-06-15T04:01:17+00:00

I realize Dataframe takes a map of {‘series_name’:Series(data, index)}. However, it automatically sorts that

  • 0

I realize Dataframe takes a map of {‘series_name’:Series(data, index)}. However, it automatically sorts that map even if the map is an OrderedDict().

Is there a simple way to pass a list of Series(data, index, name=name) such that the order is preserved and the column names are the series.name? Is there an easy way if all the indices are the same for all the series?

I normally do this by just passing a numpy column_stack of series.values and specifying the column names. However, this is ugly and in this particular case the data is strings not floats.

  • 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-15T04:01:18+00:00Added an answer on June 15, 2026 at 4:01 am

    You could use pandas.concat:

    import pandas as pd
    from pandas.util.testing import rands
    
    data = [pd.Series([rands(4) for j in range(6)],
                      index=pd.date_range('1/1/2000', periods=6),
                      name='col'+str(i)) for i in range(4)]
    
    df = pd.concat(data, axis=1, keys=[s.name for s in data])
    print(df)
    

    yields

                col0  col1  col2  col3
    2000-01-01  GqcN  Lwlj  Km7b  XfaA
    2000-01-02  lhNC  nlSm  jCYu  XLVb
    2000-01-03  sSRz  PFby  C1o5  0BJe
    2000-01-04  khZb  Ny9p  crUY  LNmc
    2000-01-05  hmLp  4rVp  xF2P  OmD9
    2000-01-06  giah  psQb  T5RJ  oLSh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just realized that when I use write.table() for saving a data frame in
I realize that tinyint is a single byte integer (by the way, is it
I realize that virtual template functions are not allowed in c++. Because of my
I realize that a SO user has formerly asked this question but it was
I realize that TWTweetComposeViewController is new to iOS 5 (which is now a bit
I realize that keywords and descriptions are old-school SEO techniques and many search engines
I realize that the align.plots function from the ggExtra package has been deprecated and
I have data.frame that contains several factors and i want to rename factor levels
I realize that the DFA is countable since the DFA for specific language is
I realize that there are many questions similar to this one, but having looked

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.