Since @github can't reliably render Jupyter notebooks, I've transferred the file to README. I still keep the Jupyter notebook in the repo in case you want to clone and run it on your machine.https://github.com/chiphuyen/python-is-cool …
-
-
Prikaži ovu nitHvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
Here's a little trick: ``` import operator product = reduce(operator.mul, nums) ```
-
One reason this is useful to know: lambdas can be very slow in python
- Još 3 druga odgovora
Novi razgovor -
-
-
Instead of : def square_fn(x): return x ** 2 better : def square_fn(x): return x * x
-
This is best practice for compiled languages, for the Python interpreter, where the implementation of built-in types and methods is very slow, calling a slow power function instead of a simple multiplication operator is an unforgivable luxury.
- Još 2 druga odgovora
Novi razgovor -
-
-
Here's the nbviewer link, since github has so much trouble rendering notebooks (including this one!) https://nbviewer.jupyter.org/github/chiphuyen/python-is-cool/blob/master/cool-python-tips.ipynb …
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
f-strings are another piece of magic worth mentioning explicitly :) They allow more than just printing variables, you can also do computations in them such as:`print(f'accuracy: {acc*100}%')`
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
Thank you. Very cool. I had no idea I could just do __dict__ = kwargs. So many wasted self.attribute = attribute!!
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
I studied from your Stanford Tensorflow course notes while starting out. They were really helpful. Thanks.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
Looks great! Might be nice to add __all__ for python classes as well. I find it super useful and efficient!
-
__slots__ is another super cool thing in python! Allows class instances to have fixed memory initialization of attributes instead of a dictionary, reducing memory consumption and improving speed.
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.