Reputation: 1 Apprentice
- Active Posts:
- 18 (0.04 per day)
- 28-December 12
- Profile Views:
- Last Active:
- Mar 26 2013 06:55 PM
- Dream Kudos:
Posts I've Made
Posted 6 Feb 2013Other than not being very pythonic or elegant, do you guys forsee a problem with this?
def xmax(r): x1 = (r) x2 = (r) xMax = max(x1,x2) return(xMax) def xmin(r): x1 = (r) x2 = (r) xMin = min(x1,x2) return(xMin)
Posted 6 Feb 2013@Darek, I like the zip idea, but I need the actual numerical values for each. @andrewsw, the axis = 0 does indeed return an entire row. The axis = 1 returns an entire column.
Posted 4 Feb 2013I've gotten a little further, but its a TOTAL KLUGE!
import numpy as np #from collections import deque ''' Created on Jan 27, 2013 @author: cameron ''' f ='/Users/cameron/Documents/workspace/findMinMax/crapc.txt' x,y,z = np.loadtxt(f, unpack=True, usecols=(1,2,3), ndmin = 2) maxZ = max(z) minZ = min(z) print("Maximum Z value: " + str(maxZ)) print("Minimum Z value: " + str(minZ)) matrix = [x,y,z] '''[[row[i] for row in matrix] for i in range(3)] #print(matrix) print()''' xyz =  for i in range(len(x)): if (matrix[i]) < 2: xyz = (matrix[i], matrix[i], matrix[i]) xyz2= (matrix[i-1], matrix[i-1], matrix[i-1]) print(xyz2)
Posted 3 Feb 2013I shall try. So far, all I've gotten is the text file read into a 'matrix'. I want to then take two complete rows from the top ( I was thinking LIFO queue, but I'm a newbie, so that is looking daunting). I would then want to use the values in those rows to work on, and then move to the next two values. From time to time, I may have to refer back to previous values though.
Posted 25 Jan 2013This is the EXACT error I'm getting.:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
cjones903 hasn't added any friends yet.