array operations in python