NumPy – 10 – Introduzione di NumPy

guardian

Continuando da qui oggi finalmente qui.

This chapter […] outlines techniques for effectively loading, storing, and manipulating in-memory data in Python. The topic is very broad: datasets can come from a wide range of sources and a wide range of formats, including be collections of documents, collections of images, collections of sound clips, collections of numerical measurements, or nearly anything else. Despite this apparent heterogeneity, it will help us to think of all data fundamentally as arrays of numbers.

For example, images –particularly digital images– can be thought of as simply two-dimensional arrays of numbers representing pixel brightness across the area. Sound clips can be thought of as one-dimensional arrays of intensity versus time. Text can be converted in various ways into numerical representations, perhaps binary digits representing the frequency of certain words or pairs of words. No matter what the data are, the first step in making it analyzable will be to transform them into arrays of numbers.

For this reason, efficient storage and manipulation of numerical arrays is absolutely fundamental to the process of doing data science. We’ll now take a look at the specialized tools that Python has for handling such numerical arrays: the NumPy package, and the Pandas package [prossimamente].

This chapter will cover NumPy in detail. NumPy (short for Numerical Python) provides an efficient interface to store and operate on dense data buffers. In some ways, NumPy arrays are like Python’s built-in list type, but NumPy arrays provide much more efficient storage and data operations as the arrays grow larger in size. NumPy arrays form the core of nearly the entire ecosystem of data science tools in Python, so time spent learning to use NumPy effectively will be valuable no matter what aspect of data science interests you.

Install Anaconda, dice Jake, uhmmm… chissà forse, NumPy dovrei averlo…

np50

Uh! devo installare Anaconda 😊

…………………………………………………………………….
[considerate che qui ci sia una lunga pausa, sto installando]
…………………………………………………………………….

OK, fatto, seguendo le indicazioni trovate qui: Download Anaconda Now.

Tarocca un po l’environment ma per Numpy kwesto&altro 😉 e ora

np51

By convention, you’ll find that most people in the SciPy/PyData world will import NumPy using np as an alias:

np52

Throughout this chapter, and indeed the rest of the book, you’ll find that this is the way we will import and use NumPy.

Un promemoria sulla documentazione
[D]on’t forget that IPython gives you the ability to quickly explore the contents of a package (by using the tab-completion feature), as well as the documentation of various functions using the ? character.

For example, to display all the contents of the numpy namespace, you can type this:

np53

Nota: dopo il punto c’è Tab, nèh!
And to display NumPy’s built-in documentation, you can use np? e inoltre info più dettagliate qui.

:mrgreen:

Annunci
Post a comment or leave a trackback: Trackback URL.

Trackbacks

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger hanno fatto clic su Mi Piace per questo: