Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.
Scott S. edited this page Jun 12, 2014 · 16 revisions

Functions

  • sin, cos, tan
  • abs
  • log
  • pow, sqrt, sum
  • fft, fft2, ifft, ifft2
  • avg, variance, std
  • logical and, or, not
  • l0, l1, l2 norm
  • real, imag, conj
  • diag

There are all functions that are very similar to NumPy's functions, if not clones. These are very simple functions: they can't handle all of the safety checks that NumPy has. They are very very rough -- expect bugs.

(fft's, logical, norms, diag and complex have yet to be implemented -- 2014-6-11)

But if you have a function that operates on a single element, you can call apply_function(single_element_function, array).

Operators

+-*/ all work element-wise. That is, zeros(3)+4 = [4,4,4]. Note that * is not a dot product operator. ones((4,4)) * ones((4,4)) == ones((4,4)). This is playing off Python's example.

*! is the dot product operator. I was going to use @ (as PEP 465 suggests), but that's not in the list of allowable custom operator characters.

~== is the "about equal" 1D operator, and ~~ is the 2D equivalent.

== works like expected

Clone this wiki locally