arange: TypeError: unsupported operand type(s) for -: 'list' and 'int'
问题 I am trying to write a very simple code which just returns an array of x from 0 to 10 in increments of 0.1, but keep getting error: x = np.arange[[0,10,0.1,np.float]] TypeError: 'builtin_function_or_method' object is not subscriptable This is my code: import numpy as np import matplotlib.pyplot as plt results = {} # creating an empty dictionary f = open (r'D:\Work\Thesis\TEST_figures\telemac_comparison_1', 'w') f.write ('Distance'+'Free surface') result = [[], []] x = np.arange([0,10,0.1,np