power level calculation ipython notebook