utah ohio texas oregon out[ ]utah ohio texas oregon named in [ ]frame sub(series axis= out[ ] utah - ohio - texas - oregon - the axis number that you pass is the axis to match on in this case we mean to match on the dataframe' row index and broadcast across function application and mapping numpy ufuncs (element-wise array methodswork fine with pandas objectsin [ ]frame dataframe(np random randn( )columns=list('bde')index=['utah''ohio''texas''oregon']in [ ]frame out[ ] utah - ohio - texas oregon - - in [ ]np abs(frameout[ ] utah ohio texas oregon another frequent operation is applying function on arrays to each column or row dataframe' apply method does exactly thisin [ ] lambda xx max( min(in [ ]frame apply(fout[ ] in [ ]frame apply(faxis= out[ ]utah ohio texas oregon many of the most common array statistics (like sum and meanare dataframe methodsso using apply is not necessary the function passed to apply need not return scalar valueit can also return series with multiple valuesin [ ]def ( )return series([ min() max()]index=['min''max']in [ ]frame apply( getting started with pandas www it-ebooks info