본문 바로가기

전체 글

(255)
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..
Python_N-001. basic commend in Numpy A summary of the basic commands for using NumPy. OperationCommandDescriptionImport NumPyimport numpy as npImport the NumPy libraryCreate Arraynp.array( [1, 2, 3] )Create an array from a listArray of Zerosnp.zeros( 5 )Create an array of zerosArray of Onesnp.ones( 5 )Create an array of onesIdentity Matrixnp.eye(3)Create a 3x3 identity matrixFull Array np.full(  (3, 3),  fill_value  ) Create an a..
Python_G-010. class vs instance ClassInstanceDefinitionBlueprint for creating objectsAn individual object created from a classAttributesDefines attributesContains data specific to the instanceMethodsDefines methodsCan use the class-defined methodsExampleclass Dog:my_dog = Dog("Buddy", 3)UsageUsed to define structure and behaviorUsed to create objects that follow the class blueprint
Python_G-009. import vs from ... import vs from... import * Aspectimportfrom ... importfrom ... import *UsageImports the entire moduleImports specific functions or classes from a moduleImports all functions, classes and variables into namespaceExampleimport mathfrom math import sqrtfrom math import *AccessRequires prefixing with module name (math.sqrt)Direct access to imported elements (sqrt)Direct access without prefix (sqrt)Pros - Avoids naming conflic..
Python_G-008. Function DefinitionA block of reusable code that performs a specific task.def function_name(parameters):Syntaxdef function_name():def greet(name):Calling a FunctionExecuting a function by using its name followed (by parentheses and arguments if needed)greet("Alice")ParametersVariables listed inside the parentheses in the function definition.def add(a, b):ArgumentsValues passed to the function when callin..
Python_G-007. List vs Tuple vs set vs dictionary FeatureListTupleSetDictionarySyntaxusing square brackets [   ]using parentheses (   )using curly braces {   }using curly braces { 'key': 'value', 'key2': 'value2' }Example[1, 2, 3](1, 2, 3){1, 2, 3}{'name': 'Alice', 'age': 30}MutabilityMutableImmutableMutableMutableOrderedYesYesNoYesAllow DuplicatesYesYesNoKeys: No, Values: YesMethodsMany built-in methods - append( item ) - remove( item ) - sort..
캐나다 세금 Top 10 주도 ('22년 기준) https://www.youtube.com/shorts/P6d0750Ixog  캐나다세금 Top 10 주도('22년 연봉 10,000 CAD 기준)
캐나다 대학교 TOP 10 & 등록금 https://www.youtube.com/shorts/yrOy8LpKheM