[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
>4030/2 >still using MATLAB instead of Python
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 107
Thread images: 4
File: 1389428717471.jpg (137 KB, 445x445) Image search: [Google]
1389428717471.jpg
137 KB, 445x445
>4030/2
>still using MATLAB instead of Python
>>
>>7727220
>I compare a general purpose, slow to execute, fast to code, super high level language to a specific purpose, lower-level, matrix-computation optimized language unironically

kill yourself desu senpai
>>
>>7727226
Not OP, but it's well known that Python's array capabilities are only slightly slower than Matlab while Cython optimized array calculations (which most scientific distros of Python have built into the interpreter) are much faster than Matlab.

Also Python is faster to code in general.

I love MATLAB, but there is a good reason that Academia is jumping ship to Python.

Also we're all freetards by heart.
>>
>>7727220
>White space sensitive

Into the shitter it goes
>>
>>7727242
>He doesn't like indenting to have reading code
>He actually likes having a fucking gazillion brackets everywhere

#ThugLife
>>
1) Python Programming: An Introduction to Computer Science by Zelle
2) Practical Programming: An Introduction to Computer Science Using Python 3 by Gries, Campbell

Which one should I choose?
>>
>>7727231
You're absolutely right. I was completely misled. Python destroys matlab, I see no reason to use matlab now.

>>7727242
>His coding style is so bad he actually notices the whitespace limitation
wow

>>7727251
I'd just go with http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/, it's really good.
>>
>>7727251
>Python 3

Not that one.

>2.7[math]\mathcal{4LYF}[/math]
>>
>>7727261
>You're absolutely right. I was completely misled. Python destroys matlab, I see no reason to use matlab now.
an anon admits he's wrong, things that never happen
>>
>>7727251
I got the Zelle book and it was meh imo
>>
>>7727251
I just started reading examples in the scipy documentation and googled the rest if I didn't know some syntax etc.

You'll be analysing data in a reasonable fashion in few hours this way. Don't waste your time on Python books.
>>
>implying Python can match MATLAB's toolbox library
>implying anything beats MATLAB's matrix manipulation libraries
>implying Python can compete with MATLAB's native index slicing

>>7727249
not wanting forced indentation =/= not liking indentation at all

also
>brackets
>MATLAB
confirmed for never using MATLAB
>>
>>7727591
Dude, nothing can match the breadth of Python libraries. Besides, many of the Matlab toolboxes are utter shit (like the PDEs one). Numpy supports literally the same index slicing as Matlab, on the other hand Matlab doesn't support negative indices which are useful as fuck (e.g., all elements of an array "a" with first and last element omitted is a[1:-1]).

The rest your meme arrows are just buzzwords. Also, single "end" is worse than infinitely nested brackets so fuck off anyway.

Besides, most of fast advanced mathematics in Matlab is just a wrapper to appropriate BLAS library which Scipy or Numpy do as well, so it's literally the same.
>>
>>7727591
>python
>unable to math ANY library

top kek, that's arguably the strongest point in favor or python. libraries are insane. also python has MKL libraries (which match MATLAB since it's the same) and also others which beat it depending on the application.
>>
>>7727619
a(1:end-1) in Matlab
>>
>>7727619
>Also, single "end" is worse than infinitely nested brackets so fuck off anyway.
it's nearly identical to how python does it. if MATLAB has to fuck off then so does Python.

>>7727642
pythoners don't like it when you have explicit shortcuts like end
>>
>>7727591
I was speaking in general since >muh forced indentation complaints mostly stem from people coming over from C++ in my experience.
>>
>>7727220
Personally, I just like Matlab because that's what we were taught (Physics undergrad), even though I learned Python on my own. In my experience, it doesn't really matter unless your datasets get beyond a certain threshold. Matlab works pretty neat and all, but Python certainly has it's advantages, since not only it is useful for crunching data, you can use it for practically any programming problem by importing libraries. So yeah, for undergrad, probably not very necessary but for grad school/everyday computing life, certainly a must.
>>
>>7727220
>being elitist about using the most pleb language ever
wew lad
>>
>>7727675
I honestly believe that Python should be taught to undergrads.

In the first place because sympy comes very close to to mathematica in capabilities so it's great as a teaching tool. Secondly it's proprietary so that keeps the FSF happy. And finally because it allows STEM grad to easily program many non-STEM things because all the useful high level packages. Things like being able to program a RaspPi controller etc. are pretty useful too.
>>
File: 1409505077535.png (7 KB, 377x330) Image search: [Google]
1409505077535.png
7 KB, 377x330
>>7727706
We learn Python in math undergrad here
>>
>>7727220
Does python have something like simulink that it can interface with very easily? If it has I'd switch to it instantly.

Still some measurement devices that I'm using interface with matlab very easily, so Matlab is going to be part of my life anyway.
>>
>>7727743
I forgot the name, OpenModellica or something like that I think, but there a few and I remember there's at least one that interfaces with Python easily, I don't think I've seen a really good alternative to simulink though.
>>
>>7727706
>proprietary
Surely you mean open source/libre.
>>
>>7727220

>Not using the right tool for the job

Also I agree Python is a better programming language than Matlab but one thing that drives me nuts about it is no smart indentation because Python doesn't use "end" or similar to denote the end of a loop, etc. Matlab does which makes smart indentation (a godsend, IMO) possible.
>>
the superior math language is GNU Octave
>>
Biochemistry/Math double maj. here. I know nothing about coding. I want to.

Where do I start?
>>
>Python
KEK

*YOU* are full of bullshit.

Python is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the Python programmers out,
that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles
Bader jokingly said "to piss you off", but it's actually true. I've come
to the conclusion that any programmer that would prefer the project to be
in Python over C is likely a programmer that I really *would* prefer to piss
off, so that he doesn't come and screw up any project I'm involved with.
>>
>Python and Matlab
>not using Scheme with SCMUTILS
>((D cube) 5) ==> 75
Does your language even differentiate, bro?
>>
>>7728256
Read Structures and Implementations of Computer Programs by Gerald Jay Sussman and Hal Abelson, and watch the MIT 6.001 lectures by Hal Albeson on YouTube. The book should be available online for free, and YouTube doesn't charge for videos, so enjoy quality learning at no charge whatsoever.
>>
python can't into stochastic time series models
>>
>>7727220
>ctl+f
>not one mention of SageMath

Step it up /sci/.
>>
>>7728459
>python can't into stochastic time series models

Yet.
>>
>>7728543
http://doc.sagemath.org/html/en/reference/finance/sage/finance/time_series.html

This? I don't know anything about stochastic processes so forgive me if this is not at all what you're looking for.
>>
Python makes me angry whenever I have to use it.
>>
>>7727220
Does any programming language have a more annoying following than Python?
>>
>>7728621
Yep:
>Java
>C (and its variants)
>Fucking FORTRAN faggots, its not the 70s anymore, move on.
>>
>>7728210
Obviously meant not* proprietary
>>
>>7728628
I didn't know Java had a following. I thought it was universally hated for the jewish gimmick gains goblin that is the JVM + depriving an entire generation of computer science graduates a proper education on memory addressing.

What is C's following? People with jobs?

Totally right on FORTRAN though.
>>
I love Python, but never thought I can replace Matlab with it.
Can I solve a transcendental equation numerically using Python? Can I make a nice 2D plot? How many lines of code will it take?
>>
>>7728648
SageMath does all of this.
>>
>>7728648
There are some libraries for that kind of thing I think. SciPy

Never used it though. Matlab does the job perfectly. I hate how it uses ~= instead of != though
>>
>>7728657
has anybody been able to install the sage python module locally and imported it in jupyter notebook?
>>
>>7728670
I don't know what that is, but if it's some kind of IDE then you should be able to use sage with it. I use eclipse to write python packages using sage all the time.
>>
>>7728670
I just looked it up. There's sage cloud for that.
>>
>>7728684
Oh wait maybe I didn't understand you question. I'm pretty sure whatever it is you want to do has been done though.
>>
>>7728628
>>Fucking FORTRAN faggots, its not the 70s anymore, move on.
kek
>>
>>7728637
JVM is fine. It's the language which most people hate.
>>
Python is just flat out better than MATLAB

If you really want to sperg out over ultra-fast matrix operations sit down and code something in a real language like C++ (or FORTRAN since you're all scientists and were taught by old physics professors who don't know how to learn to write code that properly compiles on more than one computer ffs)
>>
>>7728718
>real language
>C++
>>
>>7728718
I think the argument for matlab is not the performance, but rather all the ready-to-use toolboxes and algorithms. As you've said, nobody uses matlab for performance computing.
>>
>>7728738
>>7728718
The speed of matrix operations are roughly the same. If I wanted to pick up a meme language, I'd skip Python and go straight to swift.
>>
>>7728648
>Can I solve a transcendental equation numerically using Python? Can I make a nice 2D plot? How many lines of code will it take?

Why would you say shit like "I love Python" when you've obviously never fucking used it? Kill yourself. Idiot.
>>
>>7727249
>>He doesn't like indenting to have reading code

>Person A indents with tabs like a sane educated man
>Person B indents manually with spaces like an autist following RMS in everyone of his quarks
>Person C indents manually with a different number of spaces like an autist following another meme coder
>What you want is the combination of code chucks from A, B, and C.

You now have to waste time re-indenting code because python can't handle different spacings.

All python is good for is quick throwaway scripts/utilities. You have to be retarded and/or a pythonhead to program large code bases in it.
>>
>>7728621
Haskel
>>
>>7728738
>python
>performance

this is what underage kiddies think nowadays, somebody kill me
>>
File: laughing_croos.jpg (37 KB, 600x400) Image search: [Google]
laughing_croos.jpg
37 KB, 600x400
>>7728958
>>Person A indents with tabs like a sane educated man
>>Person B indents manually with spaces like an autist following RMS in everyone of his quarks
wait...you actually, unironically think that people who use spaces for indenting do it manually?

You're a retard bro, not even being funny here you are completely spacked. 100% potato mode.

never say anything again in your life. ever.
>>
>>7728862
I used it before, but for real programming, not math masturbation.
>>
>>7728998

I'VE SEEN THEM DO IT MANUALLY. THEIR AUTISM KNOWS NO LIMIT.
>>
>>7728998
people who are born before IDE's always indent manually kiddo
>>
>>7729054
emacs has been around for like 30 years, so you must be really old and hence irrelevant.
>>
>>7729062
>coding in emac/vim

You're the cancer killing coding
>>
>>7729054
Who needs an IDE? Every text editor that does more than Notepad indents with spaces. Tab characters aren't even system independent.
>>
>>7729062
protip: Jesus didn't make emacs, somebody had to write it
>>
>>7729066
slow down grandad, your foggy mind has misunderstood that post. You gave the lack of an IDE as an excuse for indenting spaces manually like an ape. My point was that to use that excuse you must be really old because even 30 years ago emacs and vi were around. I do not use emacs or vi.

All this, just because your idiocy and flagrant lack of wit made you think that people indent spaces manually. I'm guessing you've learned coding recently and probably have never programmed in a professional environment before.
>>
>>7728958
>python can't handle different spacings.
But that's wrong, as long as it's a single indent it can be any size, you can have one space indent.

The only person that would suffer is cerson C, and person C is a fucking retard.

>All python is good for is quick throwaway scripts/utilities. You have to be retarded and/or a pythonhead to program large code bases in it.
Except it happens to have one of the best data handling modules of any language.

This is coming from someone who mostly programs in C for work.
>>
>>7728998
loled.
>>
>>7729091
>modules

I can write a library in javascript that handles large data sets except that doesn't make javascript good
>>
>>7729093
Right, lets talk built in then.

What language can handle scientific data easily? You want decent array processing and MATLAB's only real competitor is Python.

Also it only takes an hour to develop as opposed to spending 3 fucking months to load shit from a csv file.
>>
>>7729099
> Right, lets talk built in then.

Python without Numpy/Scipy is basically rubbish for scientific computing...

> Also it only takes an hour to develop as opposed to spending 3 fucking months to load shit from a csv file.

3 months just to load data from a cvs file? Are you trying to do this in fucking machine code or something!?
>>
>>7729106
>Python without Numpy/Scipy is basically rubbish for scientific computing...
I agree in the sense that if you're planning to use their built optimization/integrator functions which at the moment is shit, but it's pretty standard for academics to use in developing and testing most NEW algorithms is usually done in Python/Cython because everything else you need like data processing and function definitions can be developed quickly allowing you to focus on the important things that actually concerns your research.


This will piss you "coder" faggot types off, but the truth is Python is going to be the next FORTRAN in 10-20 years.
>>
File: best.png (526 KB, 593x594) Image search: [Google]
best.png
526 KB, 593x594
What about Julia?

I think it's a bit on the rise.
>>
>>7728628
>>7728718
FORTAN did nothing wrong.
>>
>>7728260
>ogrammers use it, to the point where it's much much
>easier to generate total and utter crap with it. Quite frankly, even if
>the choice of C were to do *nothing* but keep the Python programmers out,
>that in itself would be a huge reason to use C.
>In other words: the choice of C is the only sane choice. I know Miles
>Bader jokingly said "to piss you off", but it's actually true. I've come
>to the conclusion that any programmer that would prefer the project to be
>in Python over C is likely a programmer that I really *would* prefer to piss
>off, so that he doesn't come and screw up any

Fuck off retard. You are probably some CS major who only cares about muh seconds. Have you ever done modelling of optical systems, particle detectors etc? If I would have an optical system using C I would go fucking nuts, because it would be so laborious. The reason for using Python/Matlab is that you can implement your ideas very quickly and execution speed is not important, since after testing you will not use that piece of code again. So fuck off to you web page creation and worrying where you can gain extra 1s when loading i.e. worthless shit without any scientific value.
>>
>>7728260
Stop quoting Torvalds, or that parody of Bjarn Strousup, or whatever you just copy and pasted. I know I've read it before.
>>
retards
>>
>>7728998
i do it manually and there's nothing wrong with this
>>
>>7727706
We learn python in undergrad physics
>>
neo-/g/ creams for fucking FIOC but then hates on fortran?

This site really is dead.
>>
>>7729080
notepad++ and vim indent with tab characters

or at least, they do on my machine
>>
>>7729304
yes there is you absolute camel
>>
>>7729099
>What language can handle scientific data easily?
R can.

>better graphing than Python
>better package library than Python
>better statistics than Python
the only thing Python does better is regex
>>
>>7729350
> whats mathplotlib
>>
>>7729357
It's inferior, is what it is.
>>
>>7729359
your mum is inferior
>>
>>7729363
rekt
>>
Bump it's too soon for this thread to die
>>
>>7729748
is it though? It's descended into a flamewar between idiot matlab shills and python coders

glad there's such a thing as sagemath tbqh
>>
>>7727242
yeah. Screw a language that emphasizes well formatted code.
>>
>>7729220
It only took a year before becoming obsolete.
>>
>>7729816
>You must code exactly my way or else!
>>
You guys tried Erlang? Hands down best language.
>>
Mathematica master race
>>
>>7729166

julia is super trendy right now (in heavy use at MIT/berkeley/stanford) but still has many rough edges

I've switched between python and julia in my last few numerical projects; it's fun messing with julia but definitely python is easier (especially due to all the library support).

I think this question will be much more interesting in 1 year when the julia ecosystem is much more mature.
>>
>>7730495

Code is't a fucking paining, it should be uniform and easy to read. Some styles deserve to be shut down, anyway.
>>
>>7728998
Except you can indent however the fuck you want in Python if you use brackets.

It only allows for non-bracketing non-retards to have clean code too if they want.
>>
>>7729093
True, python libraries also are buggy and unreliable.
Look at pandas github page. It has over 1000 open bug reports, and the code is so shitty that fixing a single one takes serious time
>>
>>7727220
97% of scientists use matlab over python
3% use python over matlab

I think it is fair to say that matlab is real.
>>
>>7727242
NO!

Back at school I saw too many people who had the most unreadable shit code with indentations everywhere and weird spaces after and in code blocks and between braces.

MANDATORY. FORCED. INDENTATION.
>>
>>7731096

That is definitely not true.
>>
>>7731185

Shouldn't be mandatory, but a standard is pretty important. A constant number of spaces for each indent (not tabs for fuck's sake) should be followed whenever possible, unless no one else is really ever going to look at whatever little script you're shitting out at that second.
>>
>>7727231
>I compare a general purpose, slow to execute, fast to code
>Also Python is faster to code in general.
wow didn't see that
THANKS BRO
>>
>>7731198
How on earth will you enforce that when some people are so ungodly stupid about it? If you only saw what I have seen. Unbelievable code, and I mean really, really unbelievable. That's what these people are running. Code that shouldn't even exist, that is so fucked up and mashed up that its a wonder they could even build it in the first place. I'm talking tier 0 normie code. Code that in order to follow you would need to 1st format and only then could you begin to map it out with a literal map. It makes me cry just thinking about it. I remember this one old programmer always talking about how he coded on a 1 bit machine 300 years ago that ran pure machine code, and would go insane for the slightest deviation from the norm. Anyway, these moron coders reduced him to babytalking them and he just ignored their formatting because he knew he couldn't do anything, their code was fucked - they were fucked - and he knew it. Basically what I'm trying to say is... Actually I forgot what I was trying to say so I'm just going to push submit without reading what shit I just wrote...
>>
>>7731190
doesn't matter, this is what global warming sheeps believe.
>>
>>7731208

How does this even happen? I don't understand how people aren't taught to format their code while they are learning to write it - no matter what the source of their learning is.
>>
>>7731208
Increase in computing power, and the accessibility of programming, allowed people to write inefficient and unmaintainable garbage and get by with it. When you let the average person in, they have no pride or vision in their work half the time, and even when they do, they end up producing a hacked together.

It sucks, but it's true. That's why computing has gone so far downhill. It's composed of people who are mentally children, if not chronologically as well. No one gives half a shit about anything,
>>
>>7731229
>aren't taught to format their code while they are learning to write it
Brah if I only knew. I don't understand how they can get to that point and have functional code. Its like they just jammed on the keyboard without looking and pushed compile.
Thread replies: 107
Thread images: 4

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.