From: Henry H. <ha...@xm...> - 2001-09-25 22:19:25
|
I often find myself wanting to append a number to a vector. After fumbling experimentation I use def comma(ar,inint): "comma(array,integer) returns array with integer appended" t=array([inint,]) return(concatenate((ar,t),1)) which is used like the comma in apl, i.e. ar <- ar, inint. This seems klutzy to me. Is there a simpler way to do it? If ar were a list, ar.append(inint) works, but no such luck after ar has become an array. Thanks, Henry Harpending, University of Utah |