a=list([['原电网最大负荷容量 PL2bmax_sum1', 70.0 ,'a', 'a'],
['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231 ,'a', 'a'],
['在最大负荷情况下,原电网的发电负荷 PL2max1' ,80.07320979180966 ,'a', 'a'],
['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195, 'a', 'a'],
['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0 ,'a' ,'a']])
#要把a删除了,最后结果为a=[['原电网最大负荷容量 PL2bmax_sum1', 70.0 ],['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231 ],['在最大负荷情况下,原电网的发电负荷 PL2max1' ,80.07320979180966 ],['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195 ],['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0 ]]
这样可以了
a=list([['原电网最大负荷容量 PL2bmax_sum1', 70.0 ,'a', 'a'],
['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231 ,'a', 'a'],
['在最大负荷情况下,原电网的发电负荷 PL2max1' ,80.07320979180966 ,'a', 'a'],
['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195, 'a', 'a'],
['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0 ,'a' ,'a']])
print(a)
for i in range(len(a)):
a[i] = [s for s in a[i] if s != 'a']
print(a)
代码如下:
a=list([['原电网最大负荷容量 PL2bmax_sum1', 70.0 ,'a', 'a'],
['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231 ,'a', 'a'],
['在最大负荷情况下,原电网的发电负荷 PL2max1' ,80.07320979180966 ,'a', 'a'],
['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195, 'a', 'a'],
['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0 ,'a' ,'a']])
print(a)
for i in range(len(a)):
a[i] = a[i][:-2]
print(a)
结果如下:
[['原电网最大负荷容量 PL2bmax_sum1', 70.0, 'a', 'a'], ['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231, 'a', 'a'], ['在最大负荷情况下,原电网的发电负荷 PL2max1', 80.07320979180966, 'a', 'a'], ['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195, 'a', 'a'], ['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0, 'a', 'a']]
[['原电网最大负荷容量 PL2bmax_sum1', 70.0], ['在最大负荷情况下,新建电网的发电负荷 PL1max1', 137.26835964310231], ['在最大负荷情况下,原电网的发电负荷 PL2max1', 80.07320979180966], ['在最大负荷情况下,总的发电负荷 PL3max1', 217.34156943491195], ['在最大负荷情况下,发电机发出的功率 PGmax1', 300.0]]