code: def example_stats(filename):
      
  
      nd = results.load_nd_from_pickle(filename=filename)
  
      nodes_df, edges_df = nd.to_dataframe()
  
      # get statistical numbers about grid
      stats = results.calculate_mvgd_stats(nd)
  
      # plot distribution of load/generation of subjacent LV grids
      stations = nodes_df[nodes_df['type'] == 'LV Station']
      f, axarr = plt.subplots(2, sharex=True)
      f.suptitle("Peak load (top) / peak generation capacity (bottom) at LV "
                 "substations in kW")
      stations['peak_load'].hist(bins=20, alpha=0.5, ax=axarr[0])
      axarr[0].set_title("Peak load in kW")
      stations['generation_capacity'].hist(bins=20, alpha=0.5, ax=axarr[1])
      axarr[1].set_title("Peak generation capacity in kW")
      plt.show()
  
      # Introduction of report
      print("You are analyzing MV grid district {mvgd}\n".format(
          mvgd=int(stats.index.values)))
  
      # print all the calculated stats
      # this isn't a particularly beautiful format but it is
      # information rich
      with option_context('display.max_rows', None,
                          'display.max_columns', None,
                          'display.max_colwidth', -1):
          print(stats.T)
docs: Obtain statistics from create grid topology
  
      Prints some statistical numbers and produces exemplary figures