Explain Codes LogoExplain Codes Logo

Python

How to invoke the super constructor in Python?

python
functions
inheritance
constructor

Is there a portable way to get the current username in Python?

python
cross-platform-compatibility
security-implications
username-retrieval

Decorators with parameters?

python
decorator-pattern
functionality
python-decorators

Why is iterating through a large Django QuerySet consuming massive amounts of memory?

python
prompt-engineering
best-practices
memory-optimization

Iterating through a range of dates in Python

python
generator-functions
pandas
dateutil

Type annotations for *args and **kwargs

python
type-hints
function-overloading
typeddict

How do I split a string into a list of characters?

python
list-comprehension
string-manipulation
python-iterator-protocol

Splitting a list into N parts of approximately equal length

python
list-splitting
numpy
array-split

How do I get a list of methods in a Python class?

python
introspection
methods
python-3

Is there a NumPy function to return the first index of something in an array?

python
numpy
array-indexing
data-science

Favorite Django Tips & Features?

python
django-annoying
virtualenv
autoloaders

Bash: pip: command not found

python
pip-installation
virtual-environments
python-3.x

Type object 'datetime.datetime' has no attribute 'datetime'

python
datetime
timedelta
strftime

Deep copy of a dict in python

python
deep-copy
data-structures
object-oriented-programming

Save classifier to disk in scikit-learn

python
scikit-learn
model-saving
data-science

Display help message with Python argparse when script is called without any arguments

python
prompt-engineering
best-practices
tools

'too many values to unpack', iterating over a dict. key=>string, value=>list

python
dictionary-iteration
python-3
unpacking-in-for-loops

How to remove axis, legends, and white padding

python
plotting
matplotlib
image-processing

How to get the return value from a thread?

python
threading
concurrent-futures
asyncio

Importerror: No module named requests

python
importerror
pip-installation
virtual-environments