SlideShare a Scribd company logo
LEZIONE 1..
PYTHON BASE
PARTE 2: strutture dati di base: liste e
dizionari; primi moduli: os, sys, numpy.
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 .. :
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
[ ]
{ }( )
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()
LEZIONE 1..
www.fordatascientist.org
B00-PyBase
B36-Slicing-Iterable.ipynb
[ ]ESTRATTORE
tupla lista Array
Ndarray
Series
DataFrame
iloc()
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
LEZIONE 1..
www.fordatascientist.org
B00-PyBase
B53-Custom-Function
CONTATTI TELEFONO
051 22 35 20
EMAIL
WORKSHOP@VICEM.IT

More Related Content

PDF
Corso Python Base: Parte 2 - ForDataScientist 01
PDF
Fordatascientist - Tecnologie Web base
PDF
Bi Mat Nhung Bo Thoi Trang Cong So Nu
DOC
6104525_Anderson_N555C_Feb_Final Project - Part 1
DOC
PDF
ÁO THỜI TRANG NỮ ĐẸP LUNG LINH VỚI GIÁ SIÊU RẺ
PPT
Sales Presentation 2-12-2016 TM
PDF
BUENAS PRACTICAS AMBIENTALES
Corso Python Base: Parte 2 - ForDataScientist 01
Fordatascientist - Tecnologie Web base
Bi Mat Nhung Bo Thoi Trang Cong So Nu
6104525_Anderson_N555C_Feb_Final Project - Part 1
ÁO THỜI TRANG NỮ ĐẸP LUNG LINH VỚI GIÁ SIÊU RẺ
Sales Presentation 2-12-2016 TM
BUENAS PRACTICAS AMBIENTALES

Viewers also liked (10)

PDF
Algeria
PPTX
The T in LGBT
PPTX
Colorado Highlands2IEA
PPTX
Inspiration
PPTX
Colorado Highlands IEA
PDF
"Teacher Inovator" contest Winner!
PDF
โครงงานคอมพิวเตอร์
PDF
Requsition user menual
PPTX
Celulita
DOCX
Global factors that are shaping UK business activity assignment 2 task 2
Algeria
The T in LGBT
Colorado Highlands2IEA
Inspiration
Colorado Highlands IEA
"Teacher Inovator" contest Winner!
โครงงานคอมพิวเตอร์
Requsition user menual
Celulita
Global factors that are shaping UK business activity assignment 2 task 2
Ad

More from Annalisa Vignoli (18)

PDF
Presentazione Corsi FDS
PDF
Python base lezione 5
PDF
Python base lezione 4
PDF
Python base lezione 3
PDF
Python base lezione 2
PDF
Python base lezione1
PDF
Web base - Javascript (Node.js): Elementi di base
PDF
Web base - SVG
PDF
Web base - CSS e selettori
PDF
Web base - HTML
PDF
WEB BASE - Una visione d'insieme delle tecnologie web
PPTX
Presentazione Ulisse - Rame
PPTX
Presentazione Ulisse - Acciaio
PDF
Fordascientist - Python reportlab
PDF
ForDataScientist - Python matplotlib
PDF
ForDataScientist - Python advanced data
PDF
ForDataScientist - Python base parte1
PDF
abstract_tesi
Presentazione Corsi FDS
Python base lezione 5
Python base lezione 4
Python base lezione 3
Python base lezione 2
Python base lezione1
Web base - Javascript (Node.js): Elementi di base
Web base - SVG
Web base - CSS e selettori
Web base - HTML
WEB BASE - Una visione d'insieme delle tecnologie web
Presentazione Ulisse - Rame
Presentazione Ulisse - Acciaio
Fordascientist - Python reportlab
ForDataScientist - Python matplotlib
ForDataScientist - Python advanced data
ForDataScientist - Python base parte1
abstract_tesi
Ad

ForDataScientist - Python base parte2