[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 3 KB, 371x196, wronganswer.png [View same] [iqdb] [saucenao] [google]
12034162 No.12034162 [Reply] [Original]

What´s all the hype about python when it actually can´t do simple maths?

>> No.12034165

Coding is a meme, is not science, is a waste of time and won't even make you money anymore.

>> No.12034177
File: 101 KB, 513x486, 1480966062659.jpg [View same] [iqdb] [saucenao] [google]
12034177

>OP doesn't know what data types are
Python coerces int4 to floating point because it's used in the same expression as 9.8, which has to be a float and can't be coerced to an int.

other languages throw an error instead, but python is designed for novices who don't know about strictly typed variables

>> No.12034180

I mean, all the other languages I´ve known can process simple float and integer expressions automatically, without this hassle

>> No.12034181

but that answer is correct, it's accounting for dark numbers

>> No.12034185

>>12034177
Are you stupid??? What other languages? None I´ve heard of.

>> No.12034187

How do you know that doing it on paper dos not yield the same result, but you don't see it because you are lazy?

>> No.12034189

>>12034180
>I mean
Opinion dismissed.

>> No.12034192

>>12034181
That answer is definitely not correct man. 9.8 - 4 is 5.8 and that is it. nothing more or less.

>> No.12034201

>>12034185
pretty sure Rust and C# both do it. Many languages automatically convert but not all.

>> No.12034203

>>12034187
this

>> No.12034210

>>12034192
>this line of thinking
wrong

>> No.12034214

Is this the designated thread for brainlets who don't understand the computer limitations of representing continuous data with discreet binary states?

>> No.12034220 [DELETED] 

>>12034201
>>12034185
also im pretty sure you have to be careful when adding floats and ints in some languages, sometimes instead of converting the int to a float, they'll truncate the float to make it an int

>> No.12034222

>>12034192
How dumb do you have to be to not get the joke. He said “dark numbers”. There’s no way that’s not a joke but you somehow mustered up the iq points to make that shitbrained reply

>> No.12034227

>>12034177
>but python is designed for novices
if it returns an incorrect answer then it surely was a bad design

>> No.12034228

>>12034162
Ok, but seriously, what did they fuck up now? Python is just getting weirder and weirder.

>> No.12034230

That looks like a normal floating point error, happens in pretty much every language.

>> No.12034244
File: 2 KB, 287x105, rversion.png [View same] [iqdb] [saucenao] [google]
12034244

>>12034201
in R.

>> No.12034257

>>12034244
this truncated the dark numbers
otherwise it should read 5.80000000000000001

>> No.12034266

>>12034222
What's up with this autistic screeching?!

>> No.12034269

>>12034181
>>12034257
What are dark numbers?

>> No.12034271

>>12034257
Who really cares about the dark numbers?

>> No.12034272

>>12034228
It's not meant to work, silly.
It's there to keep data scientists busy, not produce results.
You want to do datascience, you have to use Excel.

But seriously though, it's meant for something quick rather than rigid, and things like matlab, or free versions of that will normally work better, even excel, but python has a library for everything, so whatever.

>> No.12034275

>>12034162
does 5.8 sharp just not exist in 64 bit floats?

>> No.12034276

>>12034272
Not sure if it was made for data science at all.

>> No.12034286
File: 48 KB, 956x604, Aug22::023048.png [View same] [iqdb] [saucenao] [google]
12034286

>>12034244

>> No.12034304

>>12034286
that´s not the default output, you had to format it to 17 digits.
in python looks like the opposite, you have to round up round(9.8-4,1) to get the standard 5.8 answer

>> No.12034309

look you faggots, quit comparing a language with its compilers.
If the compiler fucks up the language, don't blame the higher-level designers, blame the eejit who wrote the compiler.

>> No.12034312

>>12034304
R rounds up shit for convenient displaying.
Python gives you raw numbers.

>> No.12034346

>>12034309
>compiler
Python is an interpreted language, there is no compilation happening.

>> No.12034361

>>12034177
>other languages throw an error instead
You clearly don't know what you're talking about.

>> No.12034373
File: 80 KB, 750x669, 1594685598082.jpg [View same] [iqdb] [saucenao] [google]
12034373

>>12034177
Midwit shit. Geniuses and low IQ people look at such worthless categories of knowledge with bewilderment and contempt.

>> No.12034378

>>12034222
>>12034266
How non autistic do you have to be not to reply to these ai pro-glamming bot posts

>> No.12034382

>>12034361
forgive him, he's a weeb

>> No.12034384

>>12034214
digit arithmetic really isnt that fucking deep

>> No.12034398

hi guys. where is the best place to learn python these days? anyone used any lessons or tutorials that are good for beginners?

>> No.12034399

>>12034398
"learn python the hard way" is what I used. got to a working point in like a month

>> No.12034407

Hey guys I’m retarded and I don’t know what floats are let me make a thread on a sci board where not many people also now what a float are. So I can talk about it. Good thread OP.

>> No.12034409

>>12034407
dark numbers*

>> No.12034411

>>12034399
im seeing that this is a book that used to be available free online? did you buy the book?

>> No.12034413

>>12034409
I knew its not a floating point error. Computers have been telling us about the truth of dark numbers this whole time.

>> No.12034414

>>12034411
Getting orielly books is always the best option. Every orielly book I ever read was great.

>> No.12034421

>>12034411
Python crash course is a good book. I have been programming my whole life and I still find the later shit useful.

>> No.12034423

>>12034411
ah I see now, when he updated it for python 3 he made it purchase only
if you want you can get the version for python 2 free online. when I took it it was a webpage. I used the guide for python 2 despite using python 3 myself, and only a few times did I run into issues. if you look up a list of things that changed between python 2 and 3 you'll probably be fine and able to anticipate these things.

or you could just buy the book, I honestly would recommend it since when I did it for free it was really helpful and it seems the book comes with even more stuff.

>> No.12034442

>>12034414
>>12034421
>>12034423
thanks a lot guys. youre all much better than those people on the other boards.

>> No.12034474

>>12034275
it might have to be a number that can be expressed as a power of 2?

>> No.12034734
File: 79 KB, 550x679, it's real I promise.jpg [View same] [iqdb] [saucenao] [google]
12034734

>>12034269

>> No.12034763

>>12034227
That's why people don't use it. Even if I used it I would actually specify types as I'm pretty sure you can do. It still should be able to get the right answer given it's designed for novice

>> No.12034766

>>12034763
>people don't use python
what? it's one of the more popular languages in STEM

>> No.12035189

>>12034763
If you are so retarded you don’t know about float point errors you aren’t doing anything important with python or any programming language anyways.

>> No.12036099

>>12034766
What I mean is many people don't use it bc bad design. It promotes bad code.
>>12035189
U should learn about float error mitigation aka not using python lol

>> No.12036211
File: 26 KB, 837x599, media_ede_ede8cf45-69fb-406d-b99a-2e5be1831f88_phpk3hvRD.png [View same] [iqdb] [saucenao] [google]
12036211

>>12034162
It's called roundoff error and happens because of imprecision in IEEE 754 floating point. Nearly all languages are susceptible to it (unless you stick to binary-coded decimals of arbitrarily large length).
Try doing a Euler approximation with a obnoxiously large amount of steps and you can eventually induce error greater than local truncation error.

>> No.12036215

>>12034181
lel

>> No.12036471

dont do python the hard way, the author is a known fucktard, do think python and then Lutz' book

>> No.12036631

>>12034165
>is a waste of time
You have to be a room temperature IQ to be this fucking retarded. Everything runs behind a code nowadays you fucking brainlet. Even in research coding is a musy to do the most tribial things

>> No.12036643
File: 875 KB, 5111x3407, emco.jpg [View same] [iqdb] [saucenao] [google]
12036643

https://0.30000000000000004.com/

>> No.12036682

>>12036631
triggered

>> No.12036706

>>12036682
Coding is talking to a computer and a computer is an incredibly powerful calculator. Every field that is not brainlet town relies on coding in some way or another

>> No.12036713

>>12034165
>Coding is a meme
>is a waste of time
lmao tell me how I know you're not a real scientist

>> No.12036730

>>12036099
Are you retarded. First of all floating point error basically never matter. I don’t know about you the most about sigfigs is 5 but usually it says around 3-4. it does have floating point error mitigation if you wanted. You’d know this if you weren’t a dumb retard. integer ratios are baked into python, you’d know it existed if you weren’t a dumb retard. I’m sure there are other things that you’d know exist or be able to search if you weren’t a dumb fuck. There are only so many ways for computers to store numbers. No matter what language or computer you are using they will have this error. If they don’t they have probably are not showing it to you.

>> No.12036764

>itt: people who are too ignorant to even know it's not about python

>> No.12036770

>>12034399
>"learn python the hard way"
waste of time for someone who already knows a language or two though

>> No.12036809

>>12036631
I'd take an IQ of 293

>> No.12036863

I only want to learn programming to plot graphs and math visualizations. What is the best langauge for this?

>> No.12036873

>it's another /sci/tards try to discuss CS episode
Christ. Don't you guys ever get tired of looking stupid?

>> No.12036885

>>12036863
python with Matplotlib or matlab which by default works well i like it better then python for this/gnu octave which is the same thing but free.

>> No.12036930

In my previous job I worked out at Intel in Folsom, California. They use Python to code pretty much all of their lab testing, so I learned a bit of Python myself, even put together a utility to read and set the IP address on some RF matrix switches they use sometimes, that are a pain in the ass to set the IP address on normally (have to do it through GPIB, LOL).
Python is just fucking weird. Compared to having programmed in C and assembly language, it makes my head hurt, some of the weird syntax. But it's best features are it's accessble and it doesn't cost anything.

>> No.12036942

>>12036863
depends on the complexity
if you can do numerical estimations of the functions, mostly working in 2D, and value speed and customization, then >>12036885 is your best bet. or MATLAB, since matplotlib is literally just built in MATLAB, but it's not free unless you have a uni license.

I'll add that if you want to plot from analytic functions, 3D visualizations, and don't care how long it takes (or care about spending money) then you might prefer Mathematica.
I generally use both of them depending on what I'm trying to plot. Scatter plots and regressions, probability distributions? I'd probably use Python since I can get it running faster. Spherical harmonics/Hydrogen wavefunctions? Mathematica 100%.

>> No.12037037

>>12036942
gnu octave is free and does mostly what matlab at least data visualization area of things. i would recommend gnu octave if you dont work at a company or uni that can give a key.

>> No.12037364

>>12034230
>He doesn't use Haskell with Data.Ratio
Not gonna make it

>> No.12037467
File: 4 KB, 410x184, 9.png [View same] [iqdb] [saucenao] [google]
12037467

>>12034162

>> No.12037484

>>12034275
https://www.youtube.com/watch?v=pQs_wx8eoQ8

>> No.12037616

>>12034162
>Do operations using floating point data structures
>Get approximate answers
It's almost like different tools are useful for different things.

>> No.12038046

>>12037364
It exists in python too.

>> No.12038052

>>12037467
It doesn’t show you the full precision

>> No.12038082

>>12038052
neither does python

>> No.12038202
File: 34 KB, 972x301, noob.png [View same] [iqdb] [saucenao] [google]
12038202

>>12034177