Войти
  • 519569Просмотров
  • 7 лет назадОпубликованоTelusko

#30 Python Tutorial for Beginners | Copying an Array in Python

Check out our courses: AI Powered DevOps with AWS - Live Course :- Coupon: TELUSKO10 (10% Discount) Complete Java Developer Course Batch-4: Coupon: TELUSKO10 (10% Discount) Master Java Spring Development : Coupon: TELUSKO20 (20% Discount) Udemy Courses: Spring: Java:- Java Spring:- Java For Programmers:- Python : Git : Docker : For More Queries WhatsApp or Call on : +919008963671 website : Instagram : Linkedin : TELUSKO Android App : Discord : In this lecture we will see: - Addition of values in an array - Different functions that can be performed on arrays - What is Aliasing in python? - Different ways of copying an array #1 - We can add any value in each element of an array. - We can also add values of two arrays. - The addition of two arrays is known as Vectorized Operation. - We can also find the values of each element of an array of mathematical operations such as sin, cos, tan, log, sqrt etc. - Sum of every element of an array can also be calculated by using the sum() function. - Minimum value can also be get from an array through the min() function. - Maximum value can be get from an array by using the max() function. - Unique elements from an array and the sorted array can also be get. - Concatenation of two arrays can also be performed by using the concatenate function. This function combines two arrays. #2 - Two variables can be pointed towards a single array. It means both variables are pointing to the same memory address where the array is stored. - In Python, Aliasing happens whenever one variable's value is assigned to another variable. - view() is a function that helps to create a new array at a new location. It means arrays should be present at the different memory addresses. - By using the view() functions, two variables will point towards two different arrays. #3 - In python, two copying techniques are available i.e., 1. Shallow Copy 2. Deep Copy - In shallow copy, it will copy elements but it means both arrays are dependent on each other. - In shallow copy, if we update an element in one array then the changes would also be reflected in another array. - In a deep copy, two different arrays are not linked with each other in any way. - In a deep copy, we use the function known as a copy() instead of using the view() function. - copy() function provides a deep copy of an array. Github :- Python for Beginners :- Java and Spring Framework For beginners with Spring Boot : - Java Tutorial for Beginners (2023) :- Subscribe to our other channel: Navin Reddy : Telusko Hindi : Donation: PayPal Id : navinreddy20 Patreon : navinreddy20