<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mean_vector(lons, lats):
 """ Returns the resultant vector from a series of longitudes and latitudes Parameters lons : array-like A sequence of longitudes (in radians) lats : array-like A sequence of latitudes (in radians) Returns ------- mean_vec : tuple (lon, lat) in radians r_value : number The magnitude of the resultant vector (between 0 and 1) This represents the degree of clustering in the data. """

    xyz = sph2cart(lons, lats)
    xyz = np.vstack(xyz).T
    mean_vec = xyz.mean(axis=0)
    r_value = np.linalg.norm(mean_vec)
    mean_vec = cart2sph(*mean_vec)
    return mean_vec, r_value