egg changed the topic of #kspacademia to: https://git.io/JqLs2 | Dogs are cats. Spiders are cat interferometers. | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> egg|nomz|egg: generally if your eyes are dewing over, that's not the weather. | <ferram4> I shall beat my problems to death with an engineer. | We can haz pdf | Logs: https://esper.irclog.whitequark.org/kspacademia
e_14159 has quit [Ping timeout: 189 seconds]
e_14159 has joined #kspacademia
egg|anbo|egg has joined #kspacademia
egg|anbo|egg_ has quit [Ping timeout: 189 seconds]
<SnoopJ>
they're probably good (numpy's docs generally are quality), but won't teach you much numpy heh
<SnoopJ>
I feel like the main thing people are missing in numpy knowledge is just like...what's going on with ndarrays, how to express things idiomatically over them (avoiding much more expensive alternatives that may be more intuitive if you don't know about the difference)
<galois>
title: Python Numpy Tutorial (with Jupyter and Colab)
<SnoopJ>
although both of those are more "cookbooky" I guess
<SnoopJ>
raptop, if there's anything in particular you wanna know or have a reference for, I have some parts of the numpy docs bookmarked as particularly-useful references
<raptop>
probably just stuff for making array operations not excessively expensive
<SnoopJ>
the first one because broadcasting operations are in general fast: loops over ndarray are basically always wrong
<SnoopJ>
second is useful because advanced indexing is *guaranteed* to copy, and copies are slow
<SnoopJ>
sometimes people will write code that ends up copying something big a bunch of times when they'd be better served by making a single copy and operating over that or something
* raptop
>_>;;
<SnoopJ>
oh uh also numba is really good now?
<SnoopJ>
I don't really use it, but it's good
<SnoopJ>
it understands ndarrays pretty well and can seriously accelerate some of those anti-idiom loops
<SnoopJ>
mostly because it turns the loop into not-Python heh
<raptop>
not-Python... FORTRAN?
<SnoopJ>
machine instructions
<SnoopJ>
@numba.jit is basically "read this Python source and get it into LLVM IR and then LLVM go brrrr"
<SnoopJ>
with some trickery to help it infer types blah blah
<SnoopJ>
but the end result is that you get code that isn't running inside the interpreter which can be just miserably slow
<SnoopJ>
`for val in some_array: ... # so much interpreter code has to run to even iterate this array, let alone what happens inside the loop`