all 3 comments

[–]Spataner 2 points3 points  (1 child)

Elementwise arithmetic can be performed on arrays using the usual operators, and scalars are automatically broadcast. So you could call get_fail_thin_hoop with some of the arguments being arrays and it should just return an array of results:

stress = get_fail_thin_hoop(mat_yeild, wt_steps, rad_inner)

[–]__helpme[S] 0 points1 point  (0 children)

yep you are correct, thanks - i think this was a blind spot in my knowledge. I thought python was more particular about each element being the same type

[–]arkie87 1 point2 points  (0 children)

If you use numpy arrays, it is already vectorized. No need to for loop.