Numpy Basic Operations

3.  Numpy Basic Operations

Arithmetic operators on arrays apply elementwise. 

import numpy as np

array11 = np.array( [[12,13],[14,15]] )   
# 2D arrray creations 
array12 = np.array( [[2,3],[4,5]] )            

array131=array11-array12                      # Basic arthimetic operations 
array132=array11-array12                       
array133= array12*2                             
 
array134=array11-array12   

array14=10*np.sin(array12)                  # Trignometric functions usage 

array15=array12<3.5                              # Conditions checking 

array161= array11 * array12                   # Elementwise product
array162= array11 @ array12                 # Matrix product
array163= array11.dot(array12)             # Matrix product


-------------------------------------------------------------------------------
Table of Content 
--------------------------------------------------------------------------------

No comments: