## 2. Creating arrays ##

import numpy as np
vector=np.array([10,20,30])
matrix=np.array([[5,10,15],[20,25,30],[35,40,45]])

## 3. Array shape ##

import numpy as np
vector_shape=vector.shape
matrix_shape=matrix.shape

## 4. Using NumPy ##

import numpy as np
world_alcohol=numpy.genfromtxt("world_alcohol.csv", delimiter=",")
print(type(world_alcohol))

## 5. Data types ##

import numpy as np
world_alcohol_dtype=world_alcohol.dtype
print(world_alcohol_dtype)

## 7. Reading in the data correctly ##

import numpy as np
world_alcohol=np.genfromtxt("world_alcohol.csv",delimiter=",",dtype="U75",skip_header=1)
print(world_alcohol)

## 8. Indexing arrays ##

import numpy as np
world_alcohol=np.genfromtxt("world_alcohol.csv",dtype="U75",delimiter=",",skip_header=1)
uruguay_other_1986=world_alcohol[1,4]
third_country=world_alcohol[2,2]
print(uruguay_other_1986)
print(third_country)

## 9. Slicing arrays ##

countries=world_alcohol[:,2]
alcohol_consumption=world_alcohol[:,4]
print(type(alcohol_consumption))


## 10. Slicing one dimension ##

first_two_columns=world_alcohol[:,0:2]
first_ten_years=world_alcohol[0:10,0]
first_ten_rows=world_alcohol[0:10,:]

## 11. Slicing arrays ##

first_twenty_regions=world_alcohol[0:20,1:3]
print(first_twenty_regions)