Be aware that you're making a copy of the data array by doing this, which I don't believe it's necessary.  If this is a catch to make sure everything is a numpy array (which everything coming from get_parameter_values is anyhow - unless is a single value) - use this instead:

data = np.asanyarray(data)