Search Results

Search found 2 results on 1 pages for 'user1440194'.

Page 1/1 | 1 

  • The truth value of an array with more than one element is ambigous when trying to index an array

    - by user1440194
    I am trying to put all elements of rbs into a new array if the elements in var(another numpy array) is =0 and <=.1 . However when I try the following code I get this error: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() rbs = [ish[4] for ish in realbooks] for book in realbooks: var -= float(str(book[0]).replace(":", "")) bidsred = rbs[(var <= .1) and (var >=0)] any ideas on what I'm doing wrong?

    Read the article

  • Find the min max and average of one column of data in python

    - by user1440194
    I have a set of data that looks like this 201206040210 -3461.00000000 -8134.00000000 -4514.00000000 -4394.00000000 0 201206040211 -3580.00000000 -7967.00000000 -4614.00000000 -7876.00000000 0 201206040212 -3031.00000000 -9989.00000000 -9989.00000000 -3419.00000000 0 201206040213 -1199.00000000 -6961.00000000 -3798.00000000 -5822.00000000 0 201206040214 -2940.00000000 -5524.00000000 -5492.00000000 -3394.00000000 0 I want to take the second to last column and find the min, max, and average. Im a little confused on how to use split when the columns are delimited by a space and -. i Figure once i do that i can use min() and max function. I have written a shell script to do the same here #!/bin/ksh awk '{print substr($5,2);}' data' > /data1 sort -n data1 > data2 tail -1 data2 head -1 data2 awk '{sum+=$1} END {print "average = ",sum/NR}' data2 Im just not sure how to do this in python. Thanks

    Read the article

1