Add Second Dimension To Numpy Function Python Code