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

  • Home
  • SEARCH
  • 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 8628003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:25:29+00:00 2026-06-12T08:25:29+00:00

I have several lists that I’m trying to enter into a data frame: mydates

  • 0

I have several lists that I’m trying to enter into a data frame:

    mydates = [0, 6, 15, 21, 30, 37, 45, 53]
    prices = [30.4, 32.5, 31.7, 31.2, 32.7, 34.1, 35.8, 37.8]
    mylist = [6.907894736842111, -2.461538461538464, -1.5772870662460567,4.807692307692319,
    4.2813455657492305, 4.985337243401747, 5.5865921787709505, -3.9682539682539684]

I enter

    df = DataFrame(prices, mylist, index=mydates, columns=['Prices', 'Percentage
    s']) 

And receive this error:

    Traceback (most recent call last):
      File "<input>", line 1, in <module>
    TypeError: __init__() got multiple values for keyword argument 'index'

While if I enter this everything works fine.

    df = DataFrame(prices, index=mydates, columns=['Prices'])

Could someone please tell me how to fix what’s wrong? .

  • 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-12T08:25:30+00:00Added an answer on June 12, 2026 at 8:25 am
    In [604]: d = {'dates' : mydates, 'prices': prices, 'mylist': mylist}
    
    In [605]: df= DataFrame(d)
    
    In [606]: print df
       dates    mylist  prices
    0      0  6.907895    30.4
    1      6 -2.461538    32.5
    2     15 -1.577287    31.7
    3     21  4.807692    31.2
    4     30  4.281346    32.7
    5     37  4.985337    34.1
    6     45  5.586592    35.8
    7     53 -3.968254    37.8
    

    EDIT:

    As Wouter Overmeire pointed out, you can use DataFrame({'prices': prices, 'mylist': mylist}, index=columnanme) to index by column.

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

Sidebar

Related Questions

I have this code. I receive several lists as parameters that I insert into
I have several unordered lists that I want to display like this: <ul> <li><img></li>
I have several lists in Matlab that I want to write to the same
I have several lists, that you can consider as rows of integers. For example
I have a page with several drop down lists that all have the same
I have several drop down lists in a table, I am trying to retrive
If I have a class that holds one or several lists, is it better
I have several models that includes nested classes and lists. Many of the class
I have a site that lists several upcoming events, and each event has a
I have an object model that contains several lists of other objects. I want

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.