我使用Python 2.7.5 numpy的形狀輸出出於某種原因,蟒蛇,當我在if語句中使用我的numpy的陣列的尺寸之一,具有比較不喜歡它: a = np.array([1,2,3,4])
# reshapes so that array has two dimensions
if len(np.shape(a)) == 1:
a = np.reshape(a, (1, np.sh
我目前嘗試使用線程編寫一個更大的python程序,並遇到了數組不必被聲明爲全局的問題。 import numpy as np
import threading
import time
import ctypes
import multiprocessing
import random
import os
def child1():
#global var
st