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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:21:12+00:00 2026-06-09T18:21:12+00:00

I’m creating a data frame in Pandas— df_data = dict() for x in data:

  • 0

I’m creating a data frame in Pandas—

df_data = dict()

for x in data:
    series = pandas.Series(x['value']['values'], index=x['value']['timestamps'])

    df_data[x['_id']] = series

df = pandas.DataFrame(df_data)

data is a list of dicts in the format—

{u'_id': u'770000000049',
 u'value': {u'timestamps': [datetime.datetime(2012, 7, 25, 10, 16, 1, 270000),
                            datetime.datetime(2012, 7, 25, 10, 18, 29, 745000),
                            datetime.datetime(2012, 7, 25, 10, 21, 54, 931000),
                            datetime.datetime(2012, 7, 25, 10, 23, 18, 896000)],
            u'values': [204.0, 16.788, 139.2, 116.004]}}

Printing an example series gives me—

>>> print df_data['770000000049']

>>> 2012-07-25 10:16:01.270000    204.000
2012-07-25 10:18:29.745000     16.788
2012-07-25 10:21:54.931000    139.200
2012-07-25 10:23:18.896000    116.004

As expected. However, printing the resulting data frame gives me—

>>> print df['770000000049']

>>> 1992-06-05 15:50:11.527680   NaN
2181-10-17 22:55:34.850625   NaN
2215-08-27 21:41:15.306049   NaN
1936-05-22 00:55:45.848401   NaN
1783-06-08 06:38:26.257076   NaN
2017-03-12 18:30:17.469108   NaN
2209-08-06 03:45:09.779652   NaN
1768-02-06 12:00:22.653272   NaN
1916-07-20 06:51:31.628376   NaN
2086-01-25 18:30:58.261336   NaN
1940-08-26 15:13:33.790568   NaN
1712-12-17 22:48:01.743241   NaN
1803-06-16 16:32:58.309017   NaN
1981-11-05 04:38:27.140059   NaN
2246-05-25 09:09:27.875035   NaN
...

WTF! The data is all wrong. Both keys and values are completely wrong.

What am I doing wrong?

Edit: Printing df gives me—

DatetimeIndex: 386 entries, 1992-06-05 15:50:11.527680 to 1774-08-13 02:00:15.237103
Data columns:
770000000006    0  non-null values
770000000009    0  non-null values
770000000010    0  non-null values
770000000011    0  non-null values
770000000012    0  non-null values
770000000013    0  non-null values
770000000018    0  non-null values
770000000020    0  non-null values
770000000021    0  non-null values
770000000022    0  non-null values
770000000024    0  non-null values
770000000029    0  non-null values
770000000030    0  non-null values
770000000032    0  non-null values
770000000034    0  non-null values
770000000049    0  non-null values
dtypes: float64(16)

Completely wrong

Edit 2:

I’ve written a module that reproduces the bug for me.

  • 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-09T18:21:13+00:00Added an answer on June 9, 2026 at 6:21 pm

    EDIT: It is a bug. I (Wes) fixed it here: https://github.com/pydata/pandas/commit/aea7c4522bd7beffd0df80efee818873110609fa


    It turns out it’s not a bug—

    While pandas does not force you to have a sorted date index, some of these methods may have unexpected or incorrect behavior if the dates are unsorted. So please be careful.

    Sorting the dates at the DB level fixed the issue for me.

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

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The 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.