Python Codes
Відкрити в Telegram
This channel will serve you all the codes and programs which are related to Python. We post the codes from the beginner level to advanced level.
Показати більше7 090
Підписники
Немає даних24 години
Немає даних7 днів
Немає даних30 день
Архів дописів
7 090
Python Tip:
You can use the calendar module in one line from the command line with python -m calendar
@Python_Codes
7 090
Python Tip:
You can use dict o
n a class instance to get all instance attributes as a dictionary
@Python_Codes7 090
Python Class Anatomy
Almost everything a Python class definition can contain summed up in one image :)
@Python_Codes
7 090
💡 Python Life Hack: Do you know you can copy the files from a computer to a mobile phone 📱 without any cable using Python 🐍 ?
@Python_Codes
7 090
💡 Python Tip: Do you know Ellipsis(...) can be used as a placeholder in Python, just like a 𝘱𝘢𝘴𝘴 statement?
@Python_Codes
7 090
Useful Pandas🐼 method you should definitely know
✅ head()
✅ info()
✅ fillna()
✅ melt()
✅ pivot()
✅ query()
✅ merge()
✅ assign()
✅ groupby()
✅ describe()
✅ sample()
✅ replace()
✅ rename()
@Python_Codes
7 090
Do you know abou .strip()
From the above example you can see that it removed all the characters mentioned in .strip('comw.') and returns the remaining string
@Python_Codes
7 090
To shuffle pandas DataFrame df
(in a reproducible way):
df = df.sample(frac=1, random_state=123).reset_index(drop=True)
Alternatively, you can use sklearn.utils.shuffle().
#pandas
@Python_Codes