小编boo*_*oof的帖子

numpy"空切片的意思".警告

更新(真正的错误)

我错误地识别了错误的来源.这是我的全部功能(对不起,如果有些线路模糊不清......)

def removeLines(input,CRVAL1,CDELT1): #Masks out the Balmer lines from the spectrum
    #Numbers 4060, 4150, 4300, 4375, 4800, and 4950 obtained from fit_RVs.pro.
    #Other numbers obtained from the Balmer absorption series lines

    for i in range(0,len(lineWindows),2):
        left = toIndex(lineWindows[i],CRVAL1,CDELT1)
        right = toIndex(lineWindows[i+1],CRVAL1,CDELT1)

        print "left = ", left
        print "right = ", right
        print "20 from right =\n", input[right:right+20]
        print "mean of 20 = ", numpy.mean(input[right:right+20])

        #Find the averages on the left and right sides
        left_avg = numpy.mean(input[left-20:left])
        right_avg …
Run Code Online (Sandbox Code Playgroud)

python numpy suppress-warnings

6
推荐指数
1
解决办法
2万
查看次数

Bash"命令未找到"错误

我正在尝试使用自定义函数编辑我的.bashrc文件以启动xwin.我希望它能够在多个窗口中打开,所以我决定创建一个接受1个参数的函数:显示数字.这是我的代码:

function test(){
    a=$(($1-0))
    "xinit -- :$a -multiwindow -clipboard &"
}
Run Code Online (Sandbox Code Playgroud)

我创建一个变量"a"来保存输入的原因是因为我怀疑输入是作为字符串而不是数字读入的.我希望采取我将输入减去0的步骤将字符串转换为整数,但我不确定它是否会.现在,当我打电话的时候

test 0
Run Code Online (Sandbox Code Playgroud)

我收到了错误

-bash: xinit -- :0 -multiwindow -clipboard &: command not found
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?谢谢!

unix bash

2
推荐指数
3
解决办法
630
查看次数

标签 统计

bash ×1

numpy ×1

python ×1

suppress-warnings ×1

unix ×1