Explain Codes LogoExplain Codes Logo

Python

How do I get the row count of a Pandas DataFrame?

python
pandas
dataframe
performance

Find the current directory and file's directory

python
pathlib
file-operations
python-3.6

How do I execute a program or call a system command?

python
subprocess
process-control
io-streaming

How to set the current working directory?

python
path-management
directory-changes
os-module

How do you extract a column from a multi-dimensional array?

python
list-comprehension
numpy
data-extraction

How do I escape curly-brace ({}) characters in a string while using .format (or an f-string)?

python
formatting
strings
f-strings

How do I protect Python code from being read by users?

python
obfuscation
security-strategies
code-protection

Using OR in SQLAlchemy

python
sqlalchemy
database-queries
data-manipulation

Get the last day of the month

python
datetime
pandas
dateutil

How to change the font size on a matplotlib plot

python
matplotlib
font-properties
responsive-design

Python Progress Bar

python
progress-bar
tqdm
concurrency

Python: Number of rows affected by cursor.execute("SELECT ...")

python
sql-injection
parametrized-queries
fetch-strategy

Hidden features of Python

python
generator-expressions
tuple-unpacking
dynamic-attributes

Replacing column values in a pandas DataFrame

python
dataframe
pandas
vectorized

How to specify "nullable" return type with type hints

python
type-hints
nullable-types
dataclasses

Correct way to write line to file?

python
file-operations
best-practices
try-except-blocks

A non-blocking read on a subprocess.PIPE in Python

python
non-blocking-io
subprocess
asyncio

How can I check if a string represents an int, without using try/except?

python
functions
best-practices
performance

How to group dataframe rows into list in pandas groupby

python
dataframe
groupby
pandas

How to install lxml on Ubuntu

python
virtualenv
pip
dependencies