verde.base.n_1d_arrays#
- verde.base.n_1d_arrays(arrays, n)[source]#
Get the first n elements from a tuple/list, convert to arrays, and ravel.
Use this function to make sure that coordinate and data arrays are ready for building Jacobian matrices and least-squares fitting.
- Parameters:
- Returns:
- 1darrays
tuple
of
arrays
The converted 1D numpy arrays.
- 1darrays
Examples
>>> import numpy as np >>> arrays = [np.arange(4).reshape(2, 2)]*3 >>> n_1d_arrays(arrays, n=2) (array([0, 1, 2, 3]), array([0, 1, 2, 3]))