Learn Python in Arabic

  Рет қаралды 29,003

Elzero Web School

Elzero Web School

Күн бұрын

Пікірлер: 35
@rouassayah
@rouassayah Жыл бұрын
أحسن واحد شارح الnumpy
@mahmoudmegahed328
@mahmoudmegahed328 3 жыл бұрын
ربنا يجازيك كل خير ويجعله في ميزان حسناتك
@wdjamilmh5210
@wdjamilmh5210 2 жыл бұрын
Return Value and Parameters of np.arange() • NumPy arange() is one of the array creation routines based on numerical ranges. It creates an instance of ndarray class (number of dimensions array) with evenly spaced values and returns the reference to it. • You can define the interval of the values contained in an array, space between them, and their type with four parameters of arange(): ○ numpy.arange([start, ]stop, [step, ], dtype=None) -> numpy.ndarray • The first three parameters determine the range of the values, while the fourth specifies the type of the elements: ○ start is the number (integer or decimal) that defines the first value in the array. ○ stop is the number that defines the end of the array and isn’t included in the array. ○ step is the number that defines the spacing (difference) between each two consecutive values in the array and defaults to 1. ○ dtype is the type of the elements of the output array and defaults to None. • step can’t be zero. Otherwise, you’ll get a ZeroDivisionError. You can’t move away anywhere from start if the increment or decrement is 0. • You can find more information on the parameters and the return value of arange() in the official documentation. ---------------------------------------- Example about np.arange() import numpy as np # Counting Forwards array_one = np.arange(start=10, stop=100, step=10, dtype=None) print(array_one) # [10 20 30 40 50 60 70 80 90] # Counting Backwards array_two = np.arange(start=10, stop=0, step=-1) print(array_two) # [10 9 8 7 6 5 4 3 2 1] ---------------------------------------- numpy.ndarray.itemsize() • function return the length of one array element in bytes. Numpy size() • In Python, numpy.size() function count the number of elements along a given axis. ---------------------------------------- Note: • This is a short way to change and push values into a list [(n1 + n2) for n1, n2 in zip(my_list1, my_list2)] • The difference between making the conjunction for two lists and two arrays my_list1 = range(elements) my_list2 = range(elements) my_array1 = np.arange(elements) my_array2 = np.arange(elements) list_result = [(n1 + n2) for n1, n2 in zip(my_list1, my_list2)] array_result = my_array1 + my_array2 ---------------------------------------- sys.getsizeof • The getsizeof() is a system-specific method and hence we have to import the sys module to use it. A sample code is as shown below for calculating the size of a list. • For example, the getsizeof() method returns 64 bytes for an empty list and then 8 bytes for every additional element. ---------------------------------------- Comparing the time consumer between lists and arrays import numpy as np import time numberOfItems = 87984659 list_one = range(numberOfItems) list_two = range(numberOfItems) array_one = np.arange(numberOfItems) array_two = np.arange(numberOfItems) timeStartList = time.time() lists = [(x + y) for x, y in zip(list_one, list_two)] timeEndList = time.time() timeStartArray = time.time() arrays = array_one + array_two timeEndArray = time.time() print(timeEndList - timeStartList) # 11.686883449554443 print(timeEndArray - timeStartArray) # 0.13801336288452148 ---------------------------------------- Comparing the memory use for arrays and lists import numpy as np import sys numberOfItems = 100 list_one = range(numberOfItems) array_one = np.arange(numberOfItems) lists = [(x) for x in list_one] print(array_one.itemsize) print(array_one.size) print(sys.getsizeof(lists[1])) print(len(lists)) print(f"The size for List: {len(lists) * sys.getsizeof(lists[1])}") # The size for List: 2800 print(f"The size for Array: {array_one.size * array_one.itemsize}") # The size for Array: 400 ------------------------------------------------------------------------- Python # ------------------------------------------------- # -- Numpy => Compare Performance And Memory Use -- # ------------------------------------------------- # - Performance # - Memory Use # ------------------------------------------------- import numpy as np import time import sys elements = 150000 my_list1 = range(elements) my_list2 = range(elements) my_array1 = np.arange(elements) my_array2 = np.arange(elements) list_start = time.time() list_result = [(n1 + n2) for n1, n2 in zip(my_list1, my_list2)] print(f"List Time: {time.time() - list_start}") array_start = time.time() array_result = my_array1 + my_array2 print(f"Array Time: {time.time() - array_start}") # for n1, n2 in zip(my_list1, my_list2): # print(n1 + n2) print(list_result) print(array_result) my_array = np.arange(100) print(my_array) print(my_array.itemsize) print(my_array.size) print(f"All Bytes: {my_array.itemsize * my_array.size}") print("#" * 50) my_list = range(100) print(sys.getsizeof(1)) print(len(my_list)) print(f"All Bytes: {sys.getsizeof(1) * len(my_list)}") -------------------------------------------------------------------------
@احمدمحمود-ب2ث5ع
@احمدمحمود-ب2ث5ع 2 жыл бұрын
جزاك الله خيرا😍
@WhyNot-h3f
@WhyNot-h3f 2 ай бұрын
للهم صل وسلم وبارك على سيدنا محمد❤
@INGOAL
@INGOAL 4 жыл бұрын
Char : 1byte Int : 4 bytes Float: 8 bytes
@takidoui5650
@takidoui5650 4 жыл бұрын
لا تقريبا: int: 2 bytes float: 4 bytes
@shaimaamadkour7650
@shaimaamadkour7650 3 жыл бұрын
هو يعني ايه byte اصلا؟
@ahmedsalamaali4137
@ahmedsalamaali4137 3 жыл бұрын
@@shaimaamadkour7650 جنب اخوك يا فواز 😅
@shaimaamadkour7650
@shaimaamadkour7650 3 жыл бұрын
@@ahmedsalamaali4137 انا تقريبا فهمت من الشرح.. Byte دي مساحته على ذاكرة الجهاز زي اي مساحة لاي ملف مثلا جيجا او ٥٠٠ كيلو بايت دا بقا بايت يعني حاجة بسيطة اوي.. دا هيفيدنا في اية معرفش الحقيقة بس دا بقا يفهمه الناس بتاعت computer science.. وياريت لو انا فاهمه غلط حد يفهمنا
@fatimaelsaadny545
@fatimaelsaadny545 2 жыл бұрын
@@shaimaamadkour7650 ال byte = 8 bit و ال bit هي أصغر وحدة تخزين في الميموري ودا ترتيبهم من الصغير للكبير bit byte kilo byte mega byte giga byte tera btye beta byte وهكذا...
@md-gv8ch
@md-gv8ch Жыл бұрын
شكرا جزيلا
@raedfarhan8452
@raedfarhan8452 4 жыл бұрын
شكرا لك استاذ
@abodawead9039
@abodawead9039 2 жыл бұрын
thank You Teacher , Great Level Course . Small Advice For All Programmers And For You Teacher , Using time.perf_counter() To Count Execution Time Is More Accurate Than Subtract The Different Between Start-Time And End-Time Using time.time() . Good Luck For All , And Thank You Again
@robbycay7570
@robbycay7570 11 ай бұрын
❤❤❤
@kirollos-samir
@kirollos-samir 4 жыл бұрын
شرح متميز
@brahim4451
@brahim4451 2 жыл бұрын
Thnx
@bachirnass1401
@bachirnass1401 Жыл бұрын
Type(my_list) => range() مش list .
@jamalmonawer1964
@jamalmonawer1964 4 жыл бұрын
ياترى ميزات الـ آراي في البايثون من حيث المساحة وسرعة الأداء موجودة نفسها في اللغات الثانية , جافا أو سي بلس بلس ؟
@عبداللهجرادات-س1ذ
@عبداللهجرادات-س1ذ 4 жыл бұрын
ال c++اسرع من البايثون كثير
@wdjamilmh5210
@wdjamilmh5210 2 жыл бұрын
Python is slower than C++, it supports dynamic typing, and it also uses the interpreter, which makes the process of compilation slower.
@youssefsamir1861
@youssefsamir1861 Жыл бұрын
يا باشمهندس لو سمحت ليه في المقارنه بين اللفت والري بنحط اللثه على انه متغير عادي نشكرك اقواس مربعه هل هي نفسها ولا هتفرق
@youssefsamir1861
@youssefsamir1861 Жыл бұрын
ليه مش بنحط اللفت في الاقواس المربع بنستخدمها زي المتغير العادي هل هي نفسها ولا هتفرق
@youssefsamir1861
@youssefsamir1861 Жыл бұрын
انا قصدي اللست سوري الكيبورد بيكتب غلط
@codingkids4287
@codingkids4287 Жыл бұрын
i, مفيش شهادة على الكورس التعلمي ده Is There A Certificate for That Course
@mohamedfathi-zr6yg
@mohamedfathi-zr6yg Жыл бұрын
في مشكلة هنا وياريت لو يبقي في توضيح من البشمهندس أسامه ، في performance test في حالة list حضرتك عملت list elements بينما في حالة array لم نقم بعملية list و بالتالي في اختلاف كبير جدا في ال performance test ارجو التوضيح و شكرا جزيلا
@oussamahamdi6993
@oussamahamdi6993 3 жыл бұрын
I Got List Time: 2.5... & Array Time: 4.2... Any explanation pls! 🤔
@mssafy2592
@mssafy2592 2 жыл бұрын
I got this result too first with the number 150 ,but when I changed to 1500000 it showed that the list took 19.33289933204651 and the array = 0.008001089096069336
@sofiantahleesh
@sofiantahleesh Жыл бұрын
prince
@elarapy1390
@elarapy1390 4 жыл бұрын
الحمد لله الواد اللي بيعمل ديس لايك لسة مدخلش على الفيديو ده ههههههههههههه
@mohamedmagdy3676
@mohamedmagdy3676 4 жыл бұрын
لو سمحت هى السلسلة ديه باقيلها كام فيديو
@codingkids4287
@codingkids4287 Жыл бұрын
تقربيا 5
@kourdroid
@kourdroid Жыл бұрын
حطيت 199900000000 في الالمنتس و الجهاز معادش يستجيب ههه😂
@SamehRSameh
@SamehRSameh 2 жыл бұрын
ليه مفيش تجديد لكورس SQL وفقا لاحتياجها فى Data Analysis
Learn Python in Arabic #146 - Numpy - Array Slicing
7:19
Elzero Web School
Рет қаралды 28 М.
AsyncIO & Asynchronous Programming in Python
12:28
NeuralNine
Рет қаралды 157 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 22 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 56 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 14 МЛН
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 39 МЛН
Learn Python in Arabic #018 - Strings Formatting The New Ways
15:19
Elzero Web School
Рет қаралды 156 М.
Learn Python in Arabic #143 - Numpy - Create Arrays
9:56
Elzero Web School
Рет қаралды 67 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Learn Python in Arabic #149 - Numpy - Array Shape And ReShape
11:50
Elzero Web School
Рет қаралды 47 М.
Memory Profiling in Python
7:07
NeuralNine
Рет қаралды 14 М.
Multithreading in Python المهام المتعددة وسرعة الأداء فى بايثون
10:11
قناة مستر ماجد التعليمية
Рет қаралды 1,1 М.
Learn Python in Arabic #056 - Function And Return
6:27
Elzero Web School
Рет қаралды 138 М.
Learn Python in Arabic #030 - Dictionary
11:05
Elzero Web School
Рет қаралды 130 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 22 МЛН