[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why is Python praised for scientific programming?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 120
Thread images: 7

File: opengraph-icon-200x200.png (8KB, 200x200px) Image search: [Google]
opengraph-icon-200x200.png
8KB, 200x200px
It's slow as fuck. Takes almost half a second to make a multiplication.

Can't do shit with it.
>>
>>8171213
> half second to do multiplication
you need to upgrade your pentium 2 grandpa
>>
>>8171218
I have Core i7.
>>
>>8171213
Python is for kids. C# is the true programming language.
>>
Fortran master race,
>>
>>8171228
Intel is for single-threaded gaming, AMD is for parallelism, though Bulldozer shat.
>>
>>8171213
even matlab is faster than python
>>
>>8171249
You take that back, I'm not a python programmer but it doesn't deserve that. I'm not even sure javascript deserves that. Maybe php.
>>
>>8171213
>High level
>Object oriented
>Muh modules
Its pretty much perfect for scientific computation, since it'll allow you to work easily in large groups and its incredibly versatile, readable, and simple to pick up and read. Moreover as my nigga here >>8171246 notes, FORTRAN is often used in science, since its particularly efficient when it comes to array processing. Python allows you to wed the two (f2py master race), which turns out to be a really useful feature.

>It's slow as fuck.
Its a common enough complaint, and there are some work around (like numba) but if you're using Python for HPC then you're doing something very wrong.

>Takes almost half a second to make a multiplication.
How big are your multiplicands?

>Can't do shit with it.
You've clearly not tried.
>>
>>8171213
PYTHON IS INTERPRETED, NOT COMPILED
>>
>>8171264
what is cpython
>>
>>8171265
A LIE

STOP BEING SO TOXIC
>>
In a very general case, when you're not processing shitload of data, it's cheaper to have computer working 10 time's longer than programmer twice.

And time is not the best measure here, as you can always outsource computations and get results quickly. Its all about $$
>>
>>8171213
[code]
In [1]: %timeit 2**1024
100000000 loops, best of 3: 12.9 ns per loop
[/code]
>>
>>8171259
>python shill
>>
>>8171304
* (time (expt 2 1024))

Evaluation took:
0.000 seconds of real time
0.000000 seconds of total run time (0.000000 user, 0.000000 system)
100.00% CPU
831 processor cycles
0 bytes consed

179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216
>>
>>8171265
cpython is the python interpreter.

did you think cpython is some magically compiled version of python?

this guy >>8171259 is right on the money. python is really, really good at glueing shit together quickly, which is why it's widely used. if you're doing anything HPC or even just production infrastructure with it, you're retarded.
>>
>>8171213
ikr, a simple loop from 1 to 10 000 took 15 seconds

i think i'll learn lua instead
>>
>>8171271
>toxic

SJW confirmed.
>>
>>8171213
I wish people who dont have a job would stop posting.
>>
>>8171249
nothing is slower than matlab.
>>
>>8171238

agreed. low level programming is the only real way to truly program something. all other methods are a "good job, you did it" button.
>>
>python
>not R
fucked up
>>
>>8171483
I doubt half of the posters on sci have any kind of job
>>
File: 1466985540437.jpg (92KB, 613x1024px) Image search: [Google]
1466985540437.jpg
92KB, 613x1024px
>he complains about language choice when he's unable to implement the Schonhage-Strassen algorithm
top kek, this board is always good for a laugh
>>
Please learn how not to code like utter shit then you'll see python is not that bad
>>
>>8171510
also, python is praised for numpy and scipy, which are both far more useful than multiplying two massive numbers together
>>
>>8171238
C#? kek
real men use C
>>
>>8171524
I use it for sympy.
MATLAB's got better syntax for matrices
>>
>>8171213
>Can't do shit with it.
Because you are shit at using it.
It is not C, don't use it like you would C.

It is used because of the vast array of libraries available for it. Scipy and numpy alone are enough to justify using it. Being able to read it, at least, is valuable for sorting out other peoples clusterfuck attempts at code (along with perl... fuck knows why people use that horror show), and luckily it is easy to read too.
>>
>>8171576
No. Python is used because kids find it too difficult to move on from their easy languages to more powerful languages.
>>
>>8171213
Because developmental time is more expensive than processing time.
>>
Try julia, it's like matlab and python had babies. And the babies are fast as fuck.
>>
has anyone here used IDL? I dont know why everyone in space/plasma physics is forced to use it
>>
>>8171213
Because you can get quick prof of concept results for small things and it is great for creating a quick framework. If I have a thermal simulator and I need to connect that with a cpu simulator and then do some work on it with some other software I have then I can write a quick script to stitch them together to get some quick results. If I need to run the same simulation framework many times, I can use python to quickly multi-thread the entire thing. If i just need to write a function and get some results and I know it won't take long to run it then python is fine as I'm not spending lots of time on it.

I'm not going to waste time writing a highly efficient c program it's overkill and going to take me longer to do it. If I'm trying to write a highly efficient function that I plan to use later then sure, I'll spend the time in C. If the point of my research is to create something fast, then I'll use C. Python isn't meant for doing that type of stuff.

That, and things like MATLAB require licences and in the end, the point of scientific research is to disseminate your results and work. Python makes that easy.
>>
>>8171490
C# is Microsoft Java what are you talking about?
>>
>>8171749
You know if they have a symbolic/cas for julia like sympy?
>>
>>8171213
I actually prefer matlab, it's easy and fun, and makes nice graphs
>>
>>8171228
i7 intel is for gayman kiddos... if you don´t have the cash to pay for the 1k+ xeons you buy amd for parrallelism they are godtier for the price
>>
>>8171213
It's good because it's easy to program in it.
>>
>>8171213

Just for fun, delete all your Python libraries from your OS (if you are using anything but Windows).
>>
>>8172027
t. *unzips dick*
>>
I agree, Python is horrible.

I program with QBASIC, it works perfectly for my scientific calculations.
>>
Serious question: when did 4chan's opinion on Python make a complete 180? 4Chan, and especially /g/, loved the shit out of Python when I started coming here 5 or so years ago. Was it when kiddies started learning it in their intro CS classes and then the elite 4channers got mad that everyone was learning their language?
>>
>>8173868
That is exactly what happened
>>
>>8171576
programming language is shit if it needs libraries made by neckbeards in order to be competent
>>
>>8171213
it's because it's ezpz and has an amazing amount of simple, powerful tools
>>
>>8173868
when people forced it from a pretty great learning language into a daily driver

it's a square peg in a round hole but everyone pretends it's a perfect fit
>>
>>8173887
That is a mental thought process you just had. I don't even know where to start.
>>
>>8173868

Hipster effect.
>>
>>8173978
it's true

devs of python were never capable of making a competent programming language

it needed neckbeard hobbyists to make it barely functional
>>
>>8171265
>cpython
Just because an interpreter is a compiled program, doesn't mean the language it interprets is a compiled language. Otherwise there would be no such thing as an interpreted language, since anything you do with computers involves compiled code somewhere along the line.

>>8171490
>C#
>low level
nice meme

>>8173593
How is QBASIC better than Python? And doesn't QBASIC only run on 16/32-bit computers?

>>8173887
So you'd rather waste time reimplementing everything yourself? Why use programming languages at all then, after all they're just "libraries" to implement common functions in machine code.

>>8174200
When creating a language, making it "barely functional" should not be a goal, since that makes too many assumptions about the environment. For example, the C language itself has no input/output functions. If you need them, you get them from the stdio.h library.
>>
>>8173868
4chan is a contrarian website for edgy teens and weeaboos, you shouldn't take the opinions stated here too seriously
>>
File: 1262629561403.jpg (226KB, 755x1255px) Image search: [Google]
1262629561403.jpg
226KB, 755x1255px
>>8174200
>Python needed neckbeard hobbyists to make it barely functional
you're retarded

wes mckinney developed pandas because he was working at a hedgefund and needed tools to develop faster than java/c++

google makes numerous upstream contributions to python ecosystem

continuum analytics is pretty close to series B funding

scipy and numpy are sponsored and funded by fucking los alamos among numerous others
>>
>>8174522
you're just sad

defending a children's programming language written by neckbeards
>>
>>8171531
Yeah, C is superior.

>>8171736
You can dev faster if you know how to program, thus saving both dev and processing time.
>>
>>8173868
I don't like it because it is not statically typed.

It's just another level of errors to check when debugging (especially when using /modifying someone else's code). has the right kind of object been passed as an argument to this method? has the method done the thing you expect it to with this new kind of argument being used as an argument?
>>
It's not praised for scientific computing except by people who don't know any better. Scientists suck at programing so they just use Python.
>>
>>8172021
bumping

Is their built in CAS for Julia?
>>
>>8174714
This is probably the first valid criticism I've seen in this thread. Here is a thread with some great points on the issue: http://stackoverflow.com/questions/42934/what-do-people-find-so-appealing-about-dynamic-languages
>>
learn python
be a poorfag
>>
>>8174522
>because he was working at a hedgefund and needed tools to develop faster than java/c++
sounds pretty neckbeardy to me
>>
>>8174763
i was thinking about this myself and honestly i think the only times ive ever actually needed/benefited from dynamic typing were basic operations that you could get the same effect from by overloading basic operators

e.g., concatenation of strings with + in python
>>
File: 1466702150280.jpg (34KB, 500x421px) Image search: [Google]
1466702150280.jpg
34KB, 500x421px
>I specialize in one language
dumb
>>
>>8171490

c# isn't low level

and for most purposes there's no reason to bullshit your way through c# when you can do it 10x faster in python, esp. for scientific programming purposes
>>
>>8174722
What's a good language for scientific computing then? FORTRAN?
>>
>>8175496
Visual basic
>>
>>8171251
Matlab is faster than most languages when it is used for vectorial programming, simply because vectorial programs can be easily distributed.

As for OP, numerical and scientific python librairies are not implemented in python, but in C or Fortran. You can use these libraries though python bindings.
>>
>programming
>>
>>8175889
Matlab is pretty powerful for scientific purposes
>>
>>8175496
C++14
>>
>>8171213
>Not writing everything in assembly
>>
>ITT: nobody actually uses Python for science

It's good because it's easy to make simple models in, you dingdongs.
>>
>>8176544
Or you could just use Matlab + Simulink
>>
http://www.stat.washington.edu/~hoytak/blog/whypython.html
>>
>>8176569
> Simulink
I threw up a little
>>
>>8176570
>massive wall of text of irrelevant points written by a fucking neckbeard
>>
>>8171490
Why do programmers feel the need to measure their dicks by how often they need to reinvent the wheel?
>>
>>8171213
I don't know if it's the best for scientific programming. Perhaps because it is easy to use. Not all scientists can become programmers, and maybe they just need a stable language to work with.
>>
>>8176605
>stable
top kek
>>
>>8176608
You can replace stable with easy if you want. Lol.
>>
>>8176612
easy but inefficient
>>
>>8175122
stop sucking dick and learn to program with good programming languages
>>
Assembly is the only way
>>
>>8176636
>Microsoft version of Java
>good
>>
>>8176970
it's the best approach to OOP aimed at software development, hands down.
>>
>>8171213
>Takes almost half a second to make a multiplication.
That's why people use libraries written in C/FORTRAN. If the problem you're solving is pretty standard, there's no reason not to use it.
Now, if there's something that requires fine tuning and new methods, then, no shit, you'll have to C(++) that shit. I do. But the thing is, most problems can be solved with standard functions you have in NumPy.
>>
>>8176970
are you fucking retarded?

c# has the best features of both java and c++
>>
>>8171254
agreed
>>
>>8176970
it's literally java if java was good
>>
>>8171213
>Why is Python praised for scientific programming?

Because it's free and copy-center. Matlab/Maple is expensive and GPL is toxic
>>
>>8171238
>>8171531
Pointing out the people who know nothing about coding languages. Python shines in gluing together components written in C.
>>
>>8171249
>implying python is slower than matslow
>>
>>8176592
when you need other shapes of wheels.
>>
>>8177705
You could just use only C instead of using small children's learning languages.
>>
>>8176977
this
>>
>>8171485
Matlab is extremely fast for numerical calculations because it relies on heavily optimized proprietary Intel libraries. It also has code auto-parallelization thanks to being a matrix-oriented programming language.
>>
>>8175496
Julia
>>
>>8178057
>>8178057
Bullshit
>>
>>8178057
matlab is just a shitty wrapper for BLAS and LAPACK.
julia, python (with numpy) and R can use the same heavily optimized proprietary intel LAPACK and BLAS implementations. And the code auto-parallelization is done by the same libraries.
paying for a programming language in 2016 is retarded, especially when the language is a hacked together pile of shit. the only good thing about matlab is the convenient matrix syntax (also found in a more consistent form in julia)
>>
>>8171213
>Why is Python praised for scientific programming?
Extremely good library support, with libraries written in C, C++ or FORTRAN. Python is only used to glue those together and the glue doesn't need to be fast.
>>
>computing things
>pleb detected

I only use LaTeX. I write down the theorem with the proof and it's done. Only plebeians need to actually crunch on numbers...
>>
>>8171249
This
>>
>>8178141
That's because you're a useless mathematician, we hard-working experimental scientists need number-crunching and simulations.
>>
>>8178117
>And the code auto-parallelization is done by the same libraries
Except that's not how it works. The parallelization is done by matlab and is only possible because of the vectorized programming model that ensures there aren't any sequential dependencies in the data like frequently occurs with loops.
>>
>>8178730
You new to programming or brain damaged by only using proprietary shitware tools for programming?
>>
>>8178735
Neither. Vrms says I only have five contrib packages on my system, but I can appreciate a well designed language beceause I'm not autistic.
>>
>ITT: C-shitters troll the fuck out of Python users (and others) for the lulz
[spoiler]which is why anyone posts anything on this cambodian crocheting imageboard[/spoiler]
>>
>>8171713
You don't know what you're talking about.

there are great reasons to use Python on this thread. Read them, and accept that those people are smarter than you
>>
>>8178735
The real problem is that you are unwilling (and/or uncapable) to program in a real and efficient language. Maybe it's best for you to leave this thread and stick to your beginner language meant for kids.
>>
>>8174729
There is a library for interfacing with it. Looked it up the other day myself, but I can't link I'm on mobile. Just google it.
>>
File: 1465161040651.jpg (16KB, 350x396px) Image search: [Google]
1465161040651.jpg
16KB, 350x396px
>>8171213
because it's easy for scientists who aren't trained in programming to use it

the main selling point of Python is that it looks like pseudocode

hardcore scientific stuff requiring multiple cores and distributed computing (like protein folding for example) use C++ or Java/JVM languages.
>>
>>8179029
quoted for truth
>>
>>8176572
Simulink is actually good.
>>
>>8171213
I think it doesn't matter which programming language you use, as long as you get your desired outcome from it.
>>
>>8179984
It really is!
>>
>>8180207
I agree, but I've found some pretty nifty languages that completely changed my way of thinking about code in general. So I'd also suggest to broaden your horizons and learn any language that may be able to offer you a new perspective. I once heard someone say that the only languages worth learning are those that have something to teach. So avoid "x and y in one" and look for approaches you haven't seen before. My most recent was Rust. I had been waiting for C++ modules for 5 years and I no longer give a shit about C++. Just googled and Modules & Concepts are both not making it into C++17, who is surprised?
>>
File: Richard-Stallman.jpg (60KB, 480x411px) Image search: [Google]
Richard-Stallman.jpg
60KB, 480x411px
>>8171490
>C#
>Low level
>>
>>8176569

Matlab is hard though

Python is easy. Get an IDE like Spyder
>>
>>8173868
Python was the meme language of the day, now it's Rust
Thread posts: 120
Thread images: 7


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.