在Python-ArcMap中查找/替换向量元素和Logit

时间:2014-01-12 16:54:50

标签: python gis arcmap

我只想使用Python在Matlab中完成以下操作:

p(p==0) = 0.001 ; p(p == 1) = 0.999; 
tVar = .5*log(p ./ (1 - p))

该操作包含Logit转换:

  1. 找到0和1,分别替换为.001和.999,
  2. 使用对数
  3. 执行第二次计算

    我在Python中尝试了以下1)无效:

    逻辑前脚本代码:

    def iLogit(a):
      return [.0001 if x==0 else x for x in a]
    

    有一个错误:

    > A field name was not found or there were unbalanced quotation marks.
    > ERROR 999999: Error executing function. Failed to execute
    > (CalculateField).
    

    enter image description here

    请帮忙吗?

0 个答案:

没有答案