def polar(a, side='right'):
 if (side not in ['right', 'left']):
  raise ValueError("`side` must be either 'right' or 'left'")
 a = np.asarray(a)
 if (a.ndim != 2):
  raise ValueError('`a` must be a 2-D array.')
 (w, s, vh) = svd(a, full_matrices=False)
 u = w.dot(vh)
 if (side == 'right'):
  p = (vh.T.conj() * s).dot(vh)
 else:
  p = (w * s).dot(w.T.conj())
 return (u, p)

def polar ( a , side = 'right' ) : if ( side not in [ 'right' , 'left' ] ) : raise ValueError ( "`side` must be either 'right' or 'left'" ) a = np . asarray ( a ) if ( a . ndim != 2 ) : raise ValueError ( '`a` must be a 2-D array.' ) ( w , s , vh ) = svd ( a , full_matrices = False ) u = w . dot ( vh ) if ( side == 'right' ) : p = ( vh . T . conj ( ) * s ) . dot ( vh ) else : p = ( w * s ) . dot ( w . T . conj ( ) ) return ( u , p )
make a polar plot .