  Countless systems in biology, physics, and finance undergo diffusive
dynamics. Many of these systems, including biomolecules inside cells, active
matter systems and foraging animals, exhibit anomalous dynamics where the
growth of the mean squared displacement with time follows a power law with an
exponent that deviates from $1$. When studying time series recording the
evolution of these systems, it is crucial to precisely measure the anomalous
exponent and confidently identify the mechanisms responsible for anomalous
diffusion. These tasks can be overwhelmingly difficult when only few short
trajectories are available, a situation that is common in the study of
non-equilibrium and living systems. Here, we present a data-driven method to
analyze single anomalous diffusion trajectories employing recurrent neural
networks, which we name RANDI. We show that our method can successfully infer
the anomalous exponent, identify the type of anomalous diffusion process, and
segment the trajectories of systems switching between different behaviors. We
benchmark our performance against the state-of-the art techniques for the study
of single short trajectories that participated in the Anomalous Diffusion
(AnDi) Challenge. Our method proved to be the most versatile method, being the
only one to consistently rank in the top 3 for all tasks proposed in the AnDi
Challenge.
