import pandas as pd
import numpy as np

my_dictionary = {'a' : 45., 'b' : -19.5, 'c' : 4444}
my_series = pd.Series(my_dictionary)
my_series

"""
Explanation: Vectorized Operations

not necessary to write loops for element-by-element operations
pandas' Series objects can be passed to MOST NumPy functions

documentation: http://pandas.pydata.org/pandas-docs/stable/basics.html
End of explanation
"""


my_series[1:] + my_series[:-1]

"""
Explanation: add Series without loop
Series within arithmetic expression
Series used as argument to NumPy function
A key difference between Series and ndarray is that operations between Series automatically align the data based on
label. Thus, you can write computations without giving consideration to whether the Series involved have the same labels.
End of explanation
"""


def multiply_by_ten (input_element):
    return input_element * 10.0

"""
Explanation: Apply Python functions on an element-by-element basis
End of explanation
"""


series_of_strings = pd.Series(['A', 'B', 'C', 'Aaba', 'Baca', np.nan, 'CABA', 'dog', 'cat'])


"""
Explanation: Vectorized string methods
Series is equipped with a set of string processing methods that make it easy to operate on each element of the array. Perhaps most importantly, these methods exclude missing/NA values automatically.
End of explanation
"""


