خرید بک لینک

Vote count: 0

I've tried to thoroughly research this question before asking it. I'm trying to plot the ratio of two lists that are contained in a dictionary.

line_ids = ['blah1','blah2','blah3','blah4']
elines = {}

for i in range(0,len(line_ids)):
    data = []
    with open('../output/'+line_ids[i]+'.csv', 'rb') as f:
        csvReader = csv.reader(f, delimiter='t')
        for row in csvReader:
            data.append(row)
        elines[line_ids[i]] = asarray(data)  

printing elines['blah1'] from the dictionary gives

[['4.6976281459143071e-40' '3.0049306872382702e-39'
  '1.9820026838968144e-38' '1.6041105541709449e-37']
 ['1.542746402089586e-35' '9.8686046391594954e-35' '6.5092653777796069e-34'
  '5.2672534967984846e-33']
 ['5.1441760072407447e-31' '3.2907875381847918e-30'
  '2.1708144830971927e-29' '1.7560195950953601e-28']
 ['1.7569718535756951e-26' '1.1242245080095899e-25'
  '7.4206530085692796e-25' '6.0042313952458629e-24']
 ['6.2845797115752487e-22' '4.0257542124265526e-21' '2.66528748586604e-20'
  '2.1666107897620966e-19']
 ['2.5547831152324016e-17' '1.6442300355147718e-16'
  '1.1022166700730511e-15' '9.1504695119123154e-15']
 ['1.5754213462395474e-12' '1.0263716591948211e-11'
  '7.0896658599931989e-11' '6.1192748118049791e-10']
 ['2.1154710788925884e-07' '1.3897595085341154e-06'
  '9.7645963829243462e-06' '8.3998195937762357e-05']
 ['0.048187475948250416' '0.31578185949368143' '2.1989098794898618'
  '18.120232380010545']
 ['13029.442003642062' '84972.769876238017' '583770.26053237868'
  '4613639.5426874915']
 ['3726334731.7746887' '24202150828.792419' '164441556532.18036'
  '1258809063091.2998']
 ['1095752351035507.6' '7094645944427608.0' '47806778370222816.0'
  '3.5753379508453267e+17']
 ['3.2816291840091796e+20' '2.1198307401280088e+21'
  '1.4197379061068677e+22' '1.0439706837407766e+23']
 ['9.9600859087036886e+25' '6.4228680979461599e+26'
  '4.2823746950774039e+27' '3.1104137359015335e+28']
 ['3.0534668934520022e+31' '1.9665558653862894e+32'
  '1.3068413234720059e+33' '9.406936707924414e+33']
 ['9.4324018968341618e+36' '6.0691075771818466e+37'
  '4.0232499374256741e+38' '2.8769493880535716e+39']]

When I try to divide two lists, I get the following when ruing the script

print divide(elines['blah1'][0],elines['blah2'][0])

NotImplemented

I thought it might have to do with the numbers being treated as strings within the list, so I tried converting them with the float() function but I get an saying only length-1 arrays can be converted to Python scalars. Ideally, I'd like to plot Column 1 of blah1 vs. Column 1 of blah 2, Column 2 of blah1 vs. Column 2 of blah2, etc.

Any help would be greatly appreciated. Thanks!

asked 41 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 14 تير 1395 ساعت: 1:23

صفحه بندی