class_docstr: Rotation in 3 dimensions.
class_docstr_tok: ["Rotation","in","3","dimensions","."]
docstr: Get the mean of the rotations.
docstr_tok: ["Get","the","mean","of","the","rotations","."]
code: def mean(self, weights: jax.Array | None = None):
      """Get the mean of the rotations."""
      w = (
          jnp.ones(self.quat.shape[0], dtype=self.quat.dtype)
          if weights is None
          else jnp.asarray(weights, dtype=self.quat.dtype)
      )
      if w.ndim != 1:
          raise ValueError(
              "Expected `weights` to be 1 dimensional, got "
              "shape {}.".format(w.shape)
          )
      if w.shape[0] != len(self):
          raise ValueError(
              "Expected `weights` to have number of values "
              "equal to number of rotations, got "
              "{} values and {} rotations.".format(
                  w.shape[0], len(self)
              )
          )
      K = jnp.dot(w[jnp.newaxis, :] * self.quat.T, self.quat)
      _, v = jnp.linalg.eigh(K)
      return Rotation(v[:, -1])
  
imports: from __future__ import annotations
  import functools
  import re
  import typing
  import scipy.spatial.transform
  import jax
  import jax.numpy
  from jax._src.numpy.util import _wraps
label_desc: Use image node_id 20 for calling the Rotation obj's underlying member method code with example usage: obj.mean(weights) and returns: Rotation