Python's namedtuples can be a great alternative to defining a class manually
#pytrick
#pytrick
You can use "json.dumps()" to pretty-print Python dicts
... (as an alternative to the "pprint" module)
#pytrick
... (as an alternative to the "pprint" module)
#pytrick
Python_Labs🐍
بی نهایت در پایتون پایتون مثبت و منفی بی نهایت واقعی داره! مثلا عددی که هیچ عددی ازش کوچکتر نیست، بدون محدودیت تعداد ارقام!
#سوال
تو مثال بالا، به نظرتون خروجی کد زیر True است یا False ؟
negative_inf < negative_inf +1
آیا واقع مثل منفی بی نهایت در ریاضی رفتار میکنه و False بر میگردونه!؟
تو مثال بالا، به نظرتون خروجی کد زیر True است یا False ؟
negative_inf < negative_inf +1
آیا واقع مثل منفی بی نهایت در ریاضی رفتار میکنه و False بر میگردونه!؟
تو پایتون میتونید از کلاس های پایه ارث برده و متناسب نیازتون override کنید.
How to inherit and extend a list object in Python? (Stackoverflow)
How to inherit and extend a list object in Python? (Stackoverflow)
پایتون زبان برنامه نویسی رسمی برای آموزش در فرانسه خواهد شد.
https://twitter.com/nnja/status/1062621193696612352
https://twitter.com/nnja/status/1062621193696612352
مقالهای در مورد معرفی ابزارهای ساخت یک برنامه تحت خط فرمان توسط پایتون
https://codeburst.io/building-beautiful-command-line-interfaces-with-python-26c7e1bb54df
https://codeburst.io/building-beautiful-command-line-interfaces-with-python-26c7e1bb54df
Medium
Building Beautiful Command Line Interfaces with Python
building a command line interface using python..
ممکنه برخورده باشید بعضی مواقع متغیر رشته ای به این صورت است!
b'salam'
Why the 'b's in front of the string? Bytes literals are always prefixed with 'b' or 'B'; they produce an instance of the bytes type instead of the str type. They may only contain ASCII characters; bytes with a numeric value of 128 or greater must be expressed with escapes.
https://stackoverflow.com/questions/6269765/what-does-the-b-character-do-in-front-of-a-string-literal
b'salam'
Why the 'b's in front of the string? Bytes literals are always prefixed with 'b' or 'B'; they produce an instance of the bytes type instead of the str type. They may only contain ASCII characters; bytes with a numeric value of 128 or greater must be expressed with escapes.
https://stackoverflow.com/questions/6269765/what-does-the-b-character-do-in-front-of-a-string-literal
Stack Overflow
What does the 'b' character do in front of a string literal?
Apparently, the following is the valid syntax:
b'The string'
I would like to know:
What does this b character in front of the string mean?
What are the effects of using it?
What are appropriate
b'The string'
I would like to know:
What does this b character in front of the string mean?
What are the effects of using it?
What are appropriate
functools — Higher-order functions and operations on callable objects
partial gives default values to the parameters of a function that would otherwise not have default values.
#pytrick
partial gives default values to the parameters of a function that would otherwise not have default values.
#pytrick
How to count the occurrence of certain item in an ndarray in Python?
فرض کنید در یک وکتور نامپای منحصر به فردها و تعداشان را میخواهید بدانید...
مناسب برای گرفتم آمار لیبل های دیتاست .
{0: 7, 1: 4, 2: 1, 3: 2, 4: 1}
فرض کنید در یک وکتور نامپای منحصر به فردها و تعداشان را میخواهید بدانید...
مناسب برای گرفتم آمار لیبل های دیتاست .
a = numpy.array([0, 3, 0, 1, 0, 1, 2, 1, 0, 0, 0, 0, 1, 3, 4])
unique, counts = numpy.unique(a, return_counts=True)
dict(zip(unique, counts))
{0: 7, 1: 4, 2: 1, 3: 2, 4: 1}
سلام.
از دوستانی که کلاس آزمایشگاه متلب داشتند و پایتون ارائه دادم؛ ممنون میشم پاسخ سوال زیر را برایم در خصوصی ارسال کنند. @alirezaweb
یکی از اساتید دیگر دانشگاه به گفته دانشگاه قصد دارد در کارگاه متلب، پایتون ارائه کند.
چه مباحثی از کلاس در چه درسهایی به کارتان آمده و چه مباحثی نیاز بود بیان شود و بیان نشده است؟
از دوستانی که کلاس آزمایشگاه متلب داشتند و پایتون ارائه دادم؛ ممنون میشم پاسخ سوال زیر را برایم در خصوصی ارسال کنند. @alirezaweb
یکی از اساتید دیگر دانشگاه به گفته دانشگاه قصد دارد در کارگاه متلب، پایتون ارائه کند.
چه مباحثی از کلاس در چه درسهایی به کارتان آمده و چه مباحثی نیاز بود بیان شود و بیان نشده است؟
Manipulate audio with a simple and easy high level interface http://pydub.com
https://github.com/jiaaro/pydub
https://github.com/jiaaro/pydub
GitHub
GitHub - jiaaro/pydub: Manipulate audio with a simple and easy high level interface
Manipulate audio with a simple and easy high level interface - jiaaro/pydub
Forwarded from Tensorflow(@CVision) (Alireza Akhavan)
#خبر
نامپای روی GPU با قابلیت autodiff و اضافه شدن JIT کامپایلر ...
(Pic: https://www.tgoop.com/cvision/813 )
JAX is NumPy on the CPU and GPU with autodiff and JIT compilation. It's just been released, try it out!
https://github.com/google/jax
همین الان روی گوگل کولب شروع کنید:
https://colab.research.google.com/github/google/jax/blob/master/notebooks/quickstart.ipynb
نامپای روی GPU با قابلیت autodiff و اضافه شدن JIT کامپایلر ...
(Pic: https://www.tgoop.com/cvision/813 )
JAX is NumPy on the CPU and GPU with autodiff and JIT compilation. It's just been released, try it out!
https://github.com/google/jax
همین الان روی گوگل کولب شروع کنید:
https://colab.research.google.com/github/google/jax/blob/master/notebooks/quickstart.ipynb
Telegram
Tensorflow
نامپای را روی GPU تصور کنید!
Python's list comprehensions are awesome
even_squares = [x * x for x in range(10) if not x % 2]
#pytrick
even_squares = [x * x for x in range(10) if not x % 2]
#pytrick