Code Monkey home page Code Monkey logo

Comments (3)

ritchie46 avatar ritchie46 commented on June 25, 2024

What is the bug here? Can you show it?

from polars.

balakhaniyan avatar balakhaniyan commented on June 25, 2024

@ritchie46
when I ran

pl.concat([a, b.rename({'data': 'data2'})], how='horizontal').sort('data').with_columns(
    (pl.col('data') - pl.col('data2')).alias('diff')
)

output is:

shape: (2_352, 3)
┌─────────────┬─────────────┬─────────┐
│ data        ┆ data2       ┆ diff    │
│ ---         ┆ ---         ┆ ---     │
│ f64         ┆ f32         ┆ f64     │
╞═════════════╪═════════════╪═════════╡
│ 1.6856309e7 ┆ 1.6856308e7 ┆ 1.0     │
│ 1.6874691e7 ┆ 1.6874692e7 ┆ -1.0    │
│ 1.6874691e7 ┆ 1.6874692e7 ┆ -1.0    │
│ 1.6874691e7 ┆ 1.6874692e7 ┆ -1.0    │
│ 1.6913661e7 ┆ 1.691366e7  ┆ 1.0     │
│ …           ┆ …           ┆ …       │
│ 7.0912e10   ┆ 7.0912e10   ┆ 22.0    │
│ 8.3216e10   ┆ 8.3216e10   ┆ 2630.0  │
│ 9.3109e10   ┆ 9.3109e10   ┆ -1275.0 │
│ 1.0732e11   ┆ 1.0732e11   ┆ 2368.0  │
│ 1.2984e11   ┆ 1.2984e11   ┆ 1616.0  │
└─────────────┴─────────────┴─────────┘

show that there are differences, is it OK?

from polars.

stinodego avatar stinodego commented on June 25, 2024

Float32 has a lower precision than Float64, so you will see a difference when representing large integer values. I would say these results are expected. Please use Float64 for better accuracy if that is relevant to your applications.

from polars.

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.