CONAN.utils.bin_data
====================

.. py:function:: CONAN.utils.bin_data(t, f, err=None, statistic='mean', bins=20)

   Bin data in time.

   :param t: Time stamps.
   :type t: array-like
   :param f: Fluxes.
   :type f: array-like
   :param err: Flux uncertainties.
   :type err: array-like
   :param statistic: Statistic to compute in each bin. ['mean','median','std','count','sum','max'] See `scipy.stats.binned_statistic`.
   :type statistic: str
   :param bins: Number of bins or bin edges. See `scipy.stats.binned_statistic`.
   :type bins: int or array-like

   :returns: * **t_bin** (*array-like*) -- Binned time stamps.
             * **f_bin** (*array-like*) -- Binned fluxes.
             * **err_bin** (*array-like*) -- Binned flux uncertainties. Only returned if `err` is not None.

