Welcome To The Case Study!: Hugo Bowne-Anderson
Welcome To The Case Study!: Hugo Bowne-Anderson
case study!
P Y T H O N D ATA S C I E N C E T O O L B O X ( PA R T 2 )
Hugo Bowne-Anderson
Data Scientist at DataCamp
World bank data
Data on world economies for over half a century
Indicators
Population
Electricity consumption
CO2 emissions
Literacy rates
Unemployment
Mortality rates
<class 'zip'>
print(list(z))
Advanced
[output expression +
conditional on output for iterator variable in iterable +
conditional on iterable]
Hugo Bowne-Anderson
Data Scientist at DataCamp
Generators for the large data limit
Use a generator to load a le line by line
def num_sequence(n):
"""Generate values from 0 to n."""
i = 0
while i < n:
yield i
i += 1
Hugo Bowne-Anderson
Data Scientist at DataCamp
Reading files in chunks
Up next:
read_csv() function and chunk_size argument
Hugo Bowne-Anderson
Data Scientist at DataCamp
You’ve applied your skills in:
User-de ned functions
Iterators
List comprehensions
Generators