User Profile

Collapse

Profile Sidebar

Collapse
kulpojke
kulpojke
Last Activity: Apr 25 '07, 08:13 AM
Joined: Apr 23 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • But F[] is a list of functions. f0...f9 are defined elsewhere and F looks like:
    Code:
    F = [f0,f1,f2,f3,f4,f5,f6,f7,f8,f9]
    ...
    See more | Go to post

    Leave a comment:


  • here it is:

    Code:
    def main(file_name):
      global i, max_lag, max_var, min_var, semivariogramz, w 
      w = [0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1]
      f = open(file_name,'r')
      data = tabfile_to_listnest(f)                                 # returns nested list
      f.close
      semivariogramz = semivar(data)                         # returns nested list
      i = len(semivariogramz) - 1
    ...
    See more | Go to post

    Leave a comment:


  • That was a good point, and i have changed the code so that the loop is no longer included, but i still get the same error.

    now then code looks like:
    Code:
    def b_maker(data,target,function):   
      b = ones((len(data)+1,1),float)                        
      for m in range(len(data)):                              
        b[m] = sqrt((data[m][0] - target[0])**2 + (data[m][1] - target[1])**2)
    ...
    See more | Go to post

    Leave a comment:


  • Trouble mapping a function to an array; what is wrong?

    I am trying to map a function to the contents of an array using the map() function. However, whenever the following function is called an error message is returned complaining that:

    ... line 121, in b_maker
    b[k] = map(function,b[k])
    TypeError: 'matrix' object is not callable

    This is on a windows32 system, using python 2.5 with the numpy library.
    In the following code data is a nested list of...
    See more | Go to post
No activity results to display
Show More
Working...