Explain Codes LogoExplain Codes Logo

Python

What's the correct way to convert bytes to a hex string in Python 3?

python
bytes
hex
conversion

How do I get the number of elements in a list (length of a list) in Python?

python
len
performance
iterators

Sending "User-agent" using Requests library in Python

python
user-agent
web-scraping
http-headers

Creating an empty Pandas DataFrame, and then filling it

python
pandas
dataframe
batch-processing

How do I use a decimal step value for range()?

python
decimal-steps
generator
itertools

Counting the number of True Booleans in a Python List

python
counting
list-comprehensions
numpy

How do I measure elapsed time in Python?

python
timing
performance
best-practices

How to install python3 version of package via pip on Ubuntu?

python
pip
virtual-environment
package-installation

Detect and exclude outliers in a pandas DataFrame

python
pandas
outliers
data-cleaning

Purpose of "%matplotlib inline"

python
matplotlib
jupyter
data-visualization

Find full path of the Python interpreter?

python
sys-executable
virtual-environments
pathfinding

Running Bash commands in Python

python
subprocess
bash-commands
best-practices

What is memoization and how can I use it in Python?

python
memoization
caching
functools

How to comment out a block of Python code in Vim

python
vim
commenting
efficiency

Fastest way to check if a value exists in a list

python
performance
binary-search
sets

How to read a file line-by-line into a list?

python
file-io
context-managers
memory-efficiency

How do you get the logical xor of two variables in Python?

python
xor
boolean
functions

How to check if the string is empty?

python
empty-string
whitespace
truthiness

Meaning of @classmethod and @staticmethod for beginner

python
classmethod
staticmethod
decorators

Transpose/unzip Function (inverse of zip)?

python
transpose
zip
data-manipulation