description greatergreater_equallessless_equalequalnot_equal perform element-wise comparisonyielding boolean array equivalent to infix operators logical_andlogical_orlogical_xor compute element-wise truth value of logical operation equivalent to infix operators >>=<<===!|data processing using arrays using numpy arrays enables you to express many kinds of data processing tasks as concise array expressions that might otherwise require writing loops this practice of replacing explicit loops with array expressions is commonly referred to as vectorization in generalvectorized array operations will often be one or two (or moreorders of magnitude faster than their pure python equivalentswith the biggest impact in any kind of numerical computations laterin will explain broadcastinga powerful method for vectorizing computations as simple examplesuppose we wished to evaluate the function sqrt( ^ ^ across regular grid of values the np meshgrid function takes two arrays and produces two matrices corresponding to all pairs of (xyin the two arraysin [ ]points np arange(- equally spaced points in [ ]xsys np meshgrid(pointspointsin [ ]ys out[ ]array([[- - - - - - ][- - - - - - ][- - - - - - ] ] ] ]]nowevaluating the function is simple matter of writing the same expression you would write with two pointsin [ ]import matplotlib pyplot as plt in [ ] np sqrt(xs * ys * in [ ] out[ ]array([ ] ] ] ] ] ]]data processing using arrays www it-ebooks info