Explain Codes LogoExplain Codes Logo

Python

Case insensitive regular expression without re.compile?

python
regex
performance
best-practices

How to read a text file into a string variable and strip newlines?

python
file-handling
string-manipulation
best-practices

How do I check if a variable exists?

python
best-practices
variable-checking
pythonic-way

Find elements in one list that are not in the other

python
set-operations
data-structures
list-comparison

How to check if a string contains an element from a list in Python

python
list-comprehensions
string-manipulation
boolean-expressions

How to use "AND" in a Django filter?

python
django
q-objects
filter-methods

Checking whether a variable is an integer or not

python
type-checking
polymorphism
try-except

Error "Import Error: No module named numpy" on Windows

python
import-error
numpy
pip-install

Difference Between Python's Generators and Iterators

python
generators
iterators
state-management

How to add an empty column to a dataframe?

python
dataframe
pandas
data-analysis

Sqlalchemy: how to filter date field?

python
sqlalchemy
date-filters
database-queries

How do I get a list of locally installed Python modules?

python
prompt-engineering
venv
pandas

String comparison in Python: is vs. ==

python
singleton
best-practices
python-quirks

Separation of business logic and data access in django

python
best-practices
mvc-patterns
django-features

Is it a good practice to use try-except-else in Python?

python
exception-handling
best-practices
error-handling

Repeat string to certain length

python
string-repetition
list-comprehension
itertools

Converting numpy dtypes to native python types

python
numpy
data-conversion
best-practices

What is the python keyword "with" used for?

python
context-managers
resource-management
best-practices

How to invert the x or y axis

python
matplotlib
plotting
data-visualization

How to ignore deprecation warnings in Python

python
deprecation-warnings
python-3
best-practices