#import numbpy
import numpy as np
# One dimensional array
cvalues = [25.3, 24.8, 26.9, 23.9]
c=np.array(cvalues)
print (c)

# Assume they are celsius measurements that we want to  convert to Fahrenheit
# List expression evaluation
print "list expression result="+str([ x*9/5+32 for x in cvalues] )
print "numbpy broadcast result="+str(c*9/5+32)  # simpler syntax

"""
Explanation: NUMPY Tutorial
https://docs.scipy.org/doc/numpy-dev/,
https://www.python-course.eu/numpy.php/
What is NUMPY?
NumPy is an acronym for "Numeric Python" or "Numerical Python"
A python package that supports the creation and manipulation of n-dimensional arrays (ndarray) of homogeneous data types.
Numpy objects are fixed at creation, adjusting the size creates a new object.
The objects in the array must all have the same type ( You can defeat this somewhat in that if you create numbpy array of lists, the lists themselves can contain different objects)
This means that mathematical operations can happen quickly since the size and type of the array elements are fixed.
Numbpy was designed for using large arrays and matrices.
SciPy (Scientific Python) extends the use of the numby ndarray's with advanced fucntions: minimization, regression, Fourier-transformation, ...
Setting up
If you already have python and pip installed the use:
pip install numpy scipy
Or follow the intstructions from http://www.numpy.org/ or https://docs.scipy.org/doc/numpy-dev/user/index.html#user
Using NUMBPY
Import it to use it
End of explanation
"""


range(1,15,2)  # operates on integers only

np.arange(-1.5,15,3.1415)  # can create any sequence of numbers

np.arange((1.0-2.5j),50,(1-4j))  #Even complex number sequences

"""
Explanation: Creating ranges using NUMBPY
Python ranges
range([start], stop[, step])
vs xrange 
Renames xrange() to range() and wraps existing range() calls with list
np.arange([start,] stop[, step,], dtype=None)  the stop value is not include in the numbers returned. Default step is one, the dtype is based on the start number format unless specified in dtype.
End of explanation
"""


