Giter Club home page Giter Club logo

Comments (1)

mroeschke avatar mroeschke commented on June 26, 2024

Thanks for the report, but this a limitation of converting floating point precision back to integers. Numpy exhibits the same behavior

In [1]: import numpy as np

In [2]: np.array([995279394541916024+i for i in range(128)]).astype('int64')
Out[2]: 
array([995279394541916024, 995279394541916025, 995279394541916026,
       995279394541916027, 995279394541916028, 995279394541916029,
       995279394541916030, 995279394541916031, 995279394541916032,
       995279394541916033, 995279394541916034, 995279394541916035,
       995279394541916036, 995279394541916037, 995279394541916038,
       995279394541916039, 995279394541916040, 995279394541916041,
       995279394541916042, 995279394541916043, 995279394541916044,
       995279394541916045, 995279394541916046, 995279394541916047,
       995279394541916048, 995279394541916049, 995279394541916050,
       995279394541916051, 995279394541916052, 995279394541916053,
       995279394541916054, 995279394541916055, 995279394541916056,
       995279394541916057, 995279394541916058, 995279394541916059,
       995279394541916060, 995279394541916061, 995279394541916062,
       995279394541916063, 995279394541916064, 995279394541916065,
       995279394541916066, 995279394541916067, 995279394541916068,
       995279394541916069, 995279394541916070, 995279394541916071,
       995279394541916072, 995279394541916073, 995279394541916074,
       995279394541916075, 995279394541916076, 995279394541916077,
       995279394541916078, 995279394541916079, 995279394541916080,
       995279394541916081, 995279394541916082, 995279394541916083,
       995279394541916084, 995279394541916085, 995279394541916086,
       995279394541916087, 995279394541916088, 995279394541916089,
       995279394541916090, 995279394541916091, 995279394541916092,
       995279394541916093, 995279394541916094, 995279394541916095,
       995279394541916096, 995279394541916097, 995279394541916098,
       995279394541916099, 995279394541916100, 995279394541916101,
       995279394541916102, 995279394541916103, 995279394541916104,
       995279394541916105, 995279394541916106, 995279394541916107,
       995279394541916108, 995279394541916109, 995279394541916110,
       995279394541916111, 995279394541916112, 995279394541916113,
       995279394541916114, 995279394541916115, 995279394541916116,
       995279394541916117, 995279394541916118, 995279394541916119,
       995279394541916120, 995279394541916121, 995279394541916122,
       995279394541916123, 995279394541916124, 995279394541916125,
       995279394541916126, 995279394541916127, 995279394541916128,
       995279394541916129, 995279394541916130, 995279394541916131,
       995279394541916132, 995279394541916133, 995279394541916134,
       995279394541916135, 995279394541916136, 995279394541916137,
       995279394541916138, 995279394541916139, 995279394541916140,
       995279394541916141, 995279394541916142, 995279394541916143,
       995279394541916144, 995279394541916145, 995279394541916146,
       995279394541916147, 995279394541916148, 995279394541916149,
       995279394541916150, 995279394541916151])

In [3]: np.array([995279394541916024+i for i in range(128)]).astype('float64').astype('int64')
Out[3]: 
array([995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916032, 995279394541916032, 995279394541916032,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160, 995279394541916160,
       995279394541916160, 995279394541916160])

Closing as the expected behavior

from pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.