PYTHON BASE
Strutture dati di base: liste e dizionari;
introduzione numpy e pandas.
COME
ORGANIZ-
ZARE I
DATI
100 324.3 ‘Italia’
533 ‘FRA’ ‘Oggi è
una bella giornata’
54.5 True 57 987
False ‘DEU’
‘config.py’
CONSIDERIAMO UNA SERIE STORICA MENSILE
maggio 2015 125.6
giugno 2015 128.3
luglio 2015 132.9
agosto 2015 133.1
settembre 2015 135.5
ottobre 2015 135.2
novembre 2015 138.6
[
125.6,
128.3,
132.9,
133.1,
135.5,
135.2,
138.6
]
DIZIONARIO
{
’201501’ : 125.6,
‘201506’ : 128.3,
‘201507’ : 132.9,
‘201508’ : 133.1 ,
‘201509’ : 135.5,
‘201510’ : 135.2,
‘201511’ : 138.6
}
LISTA
[
125.6,
128.3,
132.9,
133.1,
135.5,
135.2,
138.6
]
DIZIONARIO
{
’201501’ : 125.6,
‘201506’ : 128.3,
‘201507’ : 132.9,
‘201508’ : 133.1 ,
‘201509’ : 135.5,
‘201510’ : 135.2,
‘201511’ : 138.6
}
LISTA
posizione 0
posizione 1
posizione 2
posizione 3
posizione 4
posizione 5
posizione 6
chiave
chiave
chiave
chiave
chiave
chiave
chiave
Assegnazione
LIS1 = [ 125.6, 128.3,
132.9, 133.1, 135.5,
135.2, 138.6 ]
DIZIONARIO
Assegnazione
DIZ1 = {
’201501’ : 125.6,
‘201506’ : 128.3,
‘201507’ : 132.9,
‘201508’ : 133.1 ,
‘201509’ : 135.5,
‘201510’ : 135.2,
‘201511’ : 138.6
}
LISTA
Estrazione
LIS1 [3]
LIS1 [1:3]
LIS1 [:3]
DIZIONARIO
Estrazione
DIZ1 [‘201508’]
LISTA
LEZIONE 1..
www.fordatascientist.org
B00-PyBase
B31-Data-Structures-Builtin
LEZIONE 1..
www.fordatascientist.org
B00-PyBase
B32-Data-Structures-Other
LEZIONE 1..
www.fordatascientist.org
B00-PyBase
B36-Slicing-Iterable.ipynb
A cosa servono le tuple
A= { (‘FRA’,’DEU’,’2015’): 765,
(‘FRA’,’ITA’,’2015’): 234,
(‘FRA’,’USA’,’2015’): 122,
(‘DEU’,’FRA’,’2016’): 975,
(‘DEU’,’ITA’,’2016’): 744,
(‘DEU’,’USA’,’2016’): 865 }
A= {‘FRA’:{’DEU’:{’2015’: 765},
’ITA’:{’2015’: 234},
’USA’:{’2015’: 122} },
‘DEU’:{’FRA’:{’2016’: 975},
’ITA’:{’2016’: 744},
‘USA’:{‘2016’: 865} }
}
Nel 2015, la Francia ha esportato verso la Germania 875 milioni di euro; verso l’Italia 234 mln di euro;
verso gli Stati Uniti 122 mln di euro;
Nel 2016, la Germania ha esportato verso la Francia 975 milioni di euro; verso l’Italia 744; verso gli
Stati Uniti 865
A['FRA']['ITA']['2015'] A [ ('FRA','ITA','2015') ]
COSTRUZIONE
ESTRAZIONE
CONTATTI TELEFONO
051 22 35 20
EMAIL
WORKSHOP@VICEM.IT
Riepilogo lezione precedente
interi, floating
point, decimal
ATTRIBUTI
METODI
OGGETTO
CLASSE
funzioni
built-in
stringhe
ITERABLE
print
len
int float
str
list set
.replace
.upper
.count
if elif else for .. in .. :
[ ]
{ }( )
Data Built-in Data Module
numpy
pandas.Array
.Series.max()
.mean()
.Ndarray
.std()
.mean(axis=1)
.DataFrame
.index
.index
.columns
.index()
.count()
.count()
.keys
.sort()
.append()
.remove()
[ ]ESTRATTORE
tupla lista Array
Ndarray
Series
DataFrame
iloc()

More Related Content

PDF
Python base 02-liste
PDF
Python base lezione 2
PDF
Python base lezione 4
PDF
Web base - SVG
PDF
ForDataScientist - Python advanced data
PDF
WEB BASE - Una visione d'insieme delle tecnologie web
PDF
Python base lezione 5
PDF
Web base - CSS e selettori
Python base 02-liste
Python base lezione 2
Python base lezione 4
Web base - SVG
ForDataScientist - Python advanced data
WEB BASE - Una visione d'insieme delle tecnologie web
Python base lezione 5
Web base - CSS e selettori

Similar to Python base lezione 3 (17)

PDF
Corso Python Base: Parte 2 - ForDataScientist 01
PDF
Strutture dati 03-stutturedatibuiltin
PDF
Data mining 03-stutturedatibuiltin
PDF
Strutture dati 03-stutturedatibuiltin
PDF
ForDataScientist - Python base parte2
PDF
Strutture dati 05-numpypandas
PDF
Strutture dati 05-numpypandas
PDF
Python advanced 01-numpypandas
PDF
Python advanced 01-numpypandas
PDF
Strutture dati 01-numeristringhe
PDF
Numpy + Pandas: Corso Python avanzato - ForDataScientist 01
PDF
Python base 01-numeristringhe
PPT
12 Struct
PPTX
Algoritmi e Calcolo Parallelo 2012/2013 - Algoritmi e Strutture Dati
PDF
School of data Trento: basic spreadsheet
PDF
NoSql - Key Value
PPTX
Database - Appunti teorici
Corso Python Base: Parte 2 - ForDataScientist 01
Strutture dati 03-stutturedatibuiltin
Data mining 03-stutturedatibuiltin
Strutture dati 03-stutturedatibuiltin
ForDataScientist - Python base parte2
Strutture dati 05-numpypandas
Strutture dati 05-numpypandas
Python advanced 01-numpypandas
Python advanced 01-numpypandas
Strutture dati 01-numeristringhe
Numpy + Pandas: Corso Python avanzato - ForDataScientist 01
Python base 01-numeristringhe
12 Struct
Algoritmi e Calcolo Parallelo 2012/2013 - Algoritmi e Strutture Dati
School of data Trento: basic spreadsheet
NoSql - Key Value
Database - Appunti teorici
Ad

More from Annalisa Vignoli (11)

PDF
Presentazione Corsi FDS
PDF
Python base lezione1
PDF
Web base - Javascript (Node.js): Elementi di base
PDF
Web base - HTML
PPTX
Presentazione Ulisse - Rame
PPTX
Presentazione Ulisse - Acciaio
PDF
Fordatascientist - Tecnologie Web base
PDF
Fordascientist - Python reportlab
PDF
ForDataScientist - Python matplotlib
PDF
ForDataScientist - Python base parte1
PDF
abstract_tesi
Presentazione Corsi FDS
Python base lezione1
Web base - Javascript (Node.js): Elementi di base
Web base - HTML
Presentazione Ulisse - Rame
Presentazione Ulisse - Acciaio
Fordatascientist - Tecnologie Web base
Fordascientist - Python reportlab
ForDataScientist - Python matplotlib
ForDataScientist - Python base parte1
abstract_tesi
Ad

Python base lezione 3