Python_Labs🐍
591 subscribers
267 photos
11 videos
28 files
204 links
Download Telegram
Sharif Data Science contest
مسابقه علوم داده دانشگاه شریف

#data_science #data_mining #mining #machine_learning #

https://datadays.sharif.edu
One-Hot Encoding
Lambda Functions

(lambda x, y: x + y)(5, 3)

#pytrick
@classmethod vs @staticmethod vs "plain" methods (part 1)
@classmethod vs @staticmethod vs "plain" methods (part 2)

#pytrick
راه های به اشتراک گذاشتنن / نمایش یا اجرای نوت بوک های پایتون به صورت آنلاین:

Ways to share/run/present Jupyter Notebooks online:

1. GitHub
2. https://nbviewer.org
3. https://kyso.io
4. https://mybinder.org
5. Kaggle Kernels: https://kaggle.com/kernels
6. Google Colab: https://colab.research.google.com
7. deepnote.org
#آموزش #psutil
چه قدر حافظه فیزکی داریم؟ تا چه مقدار اگر حافظه استفاده کنیم سیستم از swap استفاده نمیکنه؟ و اطلاعات آماری مفید دیگر از حافظه RAM با psutil در پایتون.

import psutil ; print(list(psutil.virtual_memory()))



Return statistics about system memory usage as a namedtuple
including the following fields, expressed in bytes:

- total:
total physical memory available.

- available:
the memory that can be given instantly to processes without the
system going into swap.
This is calculated by summing different memory values depending
on the platform and it is supposed to be used to monitor actual
memory usage in a cross platform fashion.

- percent:
the percentage usage calculated as (total - available) / total * 100

- used:
memory used, calculated differently depending on the platform and
designed for informational purposes only:
macOS: active + inactive + wired
BSD: active + wired + cached
Linux: total - free

- free:
memory not being used at all (zeroed) that is readily available;
note that this doesn't reflect the actual memory available
(use 'available' instead)


https://t.iss.one/PyLab/325
https://t.iss.one/PyLab/324

import psutil
print(list(psutil.virtual_memory()))
#آموزش

احتمالا مواجه شدید که اگر در محیط interactive فایلی را import کنید و سپس آن فایل را ویرایش کنید. با import مجدد دیگر تغییراتتان را مشاهده نمیکنید و مجبورید مثلا نوت بوک را ریستارت کنید.
برا حل این موضوع کافیه آن را reload کنید.

# Load custom functions
import example

# For reloading after making changes
import importlib
importlib.reload(example)
from example import *
در panda میتوانید چولگی توزیع داده را با متد زیر مشخص کنید:


df.skew()
#آموزش

Using XGBoost in Python

یک روش یادگیری ماشین انعطاف پذیر محبوب در سالهای اخیر که در مسائل رگرسیون، طبقه بندی و رنکینگ میتونه استفاده بشه.
در چالش های کگل برنده های زیادی از این روش استفاده کرده اند.
آموزش ساده آن در پایتون را میتوانید بخوانید.

https://www.datacamp.com/community/tutorials/xgboost-in-python

#XGBoost
باگی که حدود 1 سال در ipython رفع نشده بود و هزاران نفر باهاش مشکل داشتند اخیرا با فقط یک خط کد رفع شد.

fix a memory leak on exception (caused by the stored traceback) #11572
https://github.com/ipython/ipython/pull/11572
Python_Labs🐍
باگی که حدود 1 سال در ipython رفع نشده بود و هزاران نفر باهاش مشکل داشتند اخیرا با فقط یک خط کد رفع شد. fix a memory leak on exception (caused by the stored traceback) #11572 https://github.com/ipython/ipython/pull/11572
برای همین ارزش یه کد به تعداد خطوطش نیست :)
توی درس برنامه نویسی پیشرفته یه سری دوستانی که میخواستند بگند خیلی پروژمون قویه تعداد خط کد زیادشون را اعلام میکردند ...
Media is too big
VIEW IN TELEGRAM
9999999999999999.0 - 9999999999999998.0 = 2

عجیب اما منطقی
دلیل این باگ به زبان #جادی
Top 20 Python libraries for Data Science (2018)