Python_EX-003. how to extract a condition dataset
import numpy as np# INPUT : SCORE ClassA = [10, 50, 70, 30]ClassB = [30, 40, 50, 60]ClassC = [76, 78, 92, 30]ClassD = [32, 45, 64, 42]A = np.array(ClassA).reshape(1,4)B = np.array(ClassB).reshape(1,4)C = np.array(ClassC).reshape(1,4)D = np.array(ClassD).reshape(1,4)Score = np.concatenate( (A, B, C, D), axis=0)print("""Score :""", Score)#path = ''#data = np.loadtxt(path, delimiter=',')cond = Scor..
Python_N-006. Array Slicing
>>> a[ 0, 3:5 ]array( [3, 4] )>>> a[ 4:, 4: ]array( [ [44, 45], [54, 55] ] )>>> a[ :, 2]array( [ 2, 12, 22, 32, 42, 52 ] )>>>> a[ 1:5:3, ::2 ]array( [ [10, 12, 14,], [40, 42, 44] ] )
Python_N-002. random module
DecriptionCode ExampleOutput (example)Generate a random float between 0 and 1random_float = np.random.rand()andom_array = np.random.rand(5)random_2d_array = np.random.rand(3, 4) 0.73206853[0.183, 0.237, ...][[0.57, 0.84], ...] Generate random integersrandom_int = np.random.randint(10)random_int_array = np.random.randint(1, 10, size=5) 7[4, 2, 6, ...] Normal distribution random numbersnormal_arra..