NumPy – 1 – oltre Python

nikon-small-world-ammonite-shell
Inizio (come annunciato qui) con Python Data Science Handbook di Jake VanderPlas. In particolare seguo (ahemmm… copio) la Jupyter notebook version. Mi sembra che Jake lo consenta, Jake rockz! 😀 e allora sono pronto per iniziare, qui: IPython: Beyond Normal Python.

Partiamo dall’inizio, dice, io uso IPython e un text-editor.
L’editor che usa Jake è più lussuoso di quello che uso io —gedit— e se posso non lo cambio, per ragioni di compatibilità con i miei contatti e poi perché sono vecchio e ai miei tempi l’editor faceva solo l’essenziale; prima del vi.

Invece come ambiente (environment, quello che io chiamo di solito REPL) Jake usa e raccoanda IPython, mi adeguo, anche perché sì rockz! 😀

IPython is about using Python effectively for interactive scientific and data-intensive computing. This chapter will start by stepping through some of the IPython features that are useful to the practice of data science, focusing especially on the syntax it offers beyond the standard features of Python. Next, we will go into a bit more depth on some of the more useful “magic commands” that can speed-up common tasks in creating and using data science code. Finally, we will touch on some of the features of the notebook that make it useful in understanding data and sharing results.

IPython può essere usato in due modi, shell e notebook; prendere quell più conveniente caso per caso, intanto vediamoli.

Lanciare la shell di Ipython
This chapter, like most of this book, is not designed to be absorbed passively. I recommend that as you read through it, you follow along and experiment with the tools and syntax we cover: the muscle-memory you build through doing this will be far more useful than the simple act of reading about it. Start by launching the IPython interpreter by typing ipython on the command-line.
C’è anche l’help, sempre di Jake: Help and Documentation in IPython.
Siccome scrivere ogni volta ipython sarebbe troppo lungo, anche perché al solito io lo faccio con opzioni, prima di subito mi sono creato l’alias:

np0

sì, lo so, ho qualche settaggio non a posto –who cares. E anche

np1

e così via 😀

Lanciare il Jupyter Notebook
The Jupyter notebook is a browser-based graphical interface to the IPython shell, and builds on it a rich set of dynamic display capabilities. As well as executing Python/IPython statements, the notebook allows the user to include formatted text, static and dynamic visualizations, mathematical equations, JavaScript widgets, and much more. Furthermore, these documents can be saved in a way that lets other people open them and execute the code on their own systems.

np2

Figo Fine, ma sapete io sono vecchio, solitario, per adesso so che c’è poi chissà… Le previsioni riguardo al futuro… (inizio-cit).

OK, per oggi basta. Anche perché –sapete– c’è sempre il rischio 😉
:mrgreen:

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Lascia un commento

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.