我有一个数组:
e = np.array([[ 0, 1, 2, 3, 5, 6, 7, 8],
[ 4, 5, 6, 7, 5, 3, 2, 5],
[ 8, 9, 10, 11, 4, 5, 3, 5]])
Run Code Online (Sandbox Code Playgroud)
我想通过RANGE中的列提取数组,如果我想在范围1到5之间取列,它将返回
e = np.array([[ 1, 2, 3, 5, ],
[ 5, 6, 7, 5, ],
[ 9, 10, 11, 4, ]])
Run Code Online (Sandbox Code Playgroud)
怎么解决?谢谢
I am trying to create an exe file from a python file that it will be executable to other PCs. I came across Nuitka.I use Python 2.7.11 Anaconda 2.3.0 (32 bit) on Windows 8.1 64 bit. Because of my work specs i can't update my Python version!!! I have download nuitka 0.5.19 for python 2.7. At first i used the simple line nuitka --exe python.py and i get an executable (with some warnings) that runs only in PCs that had …
我正在尝试使用Tkinter和Python 2.7创建GUI。它必须具有七段显示或类似于根据变量动态显示值的内容。除了手动图形设计之外,还有什么方法可以创建七段式显示器(这会减慢整个系统的速度)?
我使用以下代码对我的字典进行排序:
meaningHash = {'Banana': 'fruit', 'apple': 'fruit'}
sortedMeaningHash = collections.OrderedDict(sorted(meaningHash.items()))
print sortedMeaningHash
Run Code Online (Sandbox Code Playgroud)
结果是:
OrderedDict([('Banana', 'fruit'), ('apple', 'fruit')])
Run Code Online (Sandbox Code Playgroud)
而期望的输出是:
OrderedDict([('apple', 'fruit'), ('Banana', 'fruit')])
Run Code Online (Sandbox Code Playgroud)