float对象是不可取消的

时间:2015-10-29 13:11:13

标签: python python-2.7

我尝试将所有num_of_cells值设置为使用此代码计算的NQ值:

import numpy as np

source_Q = 4
source_N = 9999.0
delta_t = 6
time = delta_t / float(3600)
delta_x = 50 * time
num_of_cells = np.int(1.25 / delta_x) + 1
N = 180 * delta_x
Q = 3000 * time
normal_cell_capacity = float(2400) / float(120)
incident_cell_capacity = float(600) / float(120)

for i in range (1, num_of_cells):
    Q = Q[i+1]
    N = N[i+1]

产生此错误:

TypeError: 'float' object is unsubscriptable

0 个答案:

没有答案