code: def dir_df_fisher_mean(dir_df):
      
      N = dir_df.dir_dec.values.shape[0]  # number of data points
      fpars = {}
      if N < 2:
          return fpars
      dirs = dir_df[['dir_dec', 'dir_inc']].values
      X = dir2cart(dirs).transpose()
      Xbar = np.array([X[0].sum(), X[1].sum(), X[2].sum()])
      R = np.sqrt(Xbar[0]**2+Xbar[1]**2+Xbar[2]**2)
      Xbar = Xbar/R
      dir = cart2dir(Xbar)
      fpars["dec"] = dir[0]
      fpars["inc"] = dir[1]
      fpars["n"] = N
      fpars["r"] = R
      if N != R:
          k = (N - 1.) / (N - R)
          fpars["k"] = k
          csd = 81./np.sqrt(k)
      else:
          fpars['k'] = 'inf'
          csd = 0.
      b = 20.**(1./(N - 1.)) - 1
      a = 1 - b * (N - R) / R
      if a < -1:
          a = -1
      a95 = np.degrees(np.arccos(a))
      fpars["alpha95"] = a95
      fpars["csd"] = csd
      if a < 0:
          fpars["alpha95"] = 180.0
      return fpars
docs: calculates fisher mean for Pandas data frame
  
      Parameters
      __________
      dir_df: pandas data frame with columns:
          dir_dec : declination
          dir_inc : inclination
      Returns
      -------
      fpars : dictionary containing the Fisher mean and statistics
          dec : mean declination
          inc : mean inclination
          r : resultant vector length
          n : number of data points
          k : Fisher k value
          csd : Fisher circular standard deviation
          alpha95 : Fisher circle of 95% confidence