NameError:名称'min_x'未定义

时间:2020-06-17 14:59:59

标签: python anaconda

enter image description here

有没有办法使该变量返回“未定义”状态?

3 个答案:

答案 0 :(得分:0)

在函数内部将变量声明为全局变量。

此外,您还没有调用函数

答案 1 :(得分:0)

您有一个可以找到min_x和max_x的函数,但尚未调用它。

像这样调整它:

def visualize(c,x,y):
  min_x,max_x = ...
  min_y,max_y = ...
return min_x,max_x,min_y,max_y

min_x,max_x,min_y,max_y = visualize(c,x,y)
x_vals,y_vals = np.meshgrid(np.arange(min_x,max_x, mesh_step_size))

答案 2 :(得分:0)

尝试一下!我认为这会帮助您

__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global
 module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  * @license
  * Lodash <https://lodash.com/>
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  * Released under MIT license <https://lodash.com/license>
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  * Copyright Jeremy Ashkenas
 DocumentCloud and Investigative Reporters & Editors
  */
  ;(function() {

   /** Used as a safe reference for `undefined` in pre-ES5 environments. */
   var undefined;

   /** Used as the semantic version number. */
   var VERSION = '4.17.15';

   /** Used as the size to enable large array optimizations. */
   var LARGE_ARRAY_SIZE = 200;

   /** Error message constants. */
   var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'

      FUNC_ERROR_TEXT = 'Expected a function';

  /** Used to stand-in for `undefined` hash values. */
  var HASH_UNDEFINED = '__lodash_hash_undefined__';

  /** Used as the maximum memoize cache size. */
  var MAX_MEMOIZE_SIZE = 500;

  /** Used as the internal argument placeholder. */
  var PLACEHOLDER = '__lodash_placeholder__';

  /** Used to compose bitmasks for cloning. */
  var CLONE_DEEP_FLAG = 1

      CLONE_FLAT_FLAG = 2

      CLONE_SYMBOLS_FLAG = 4;

  /** Used to compose bitmasks for value comparisons. */
  var COMPARE_PARTIAL_FLAG = 1