Explain Codes LogoExplain Codes Logo

Python

Logger Configuration to Log to File and Print to STDOUT

python
logging
handlers
configuration

Create a Pandas Dataframe by appending one row at a time

python
dataframe
performance
data-transformation

How to set environment variables in Python?

python
environment-variables
dotenv
subprocess

How do I lowercase a string in Python?

python
string-manipulation
unicode
best-practices

What is Python's equivalent of && (logical-and) in an if-statement?

python
logical-operators
short-circuiting
pep8

Check if a given key already exists in a dictionary

python
key-checks
defaultdict
performance

Why dict.get(key) instead of dict[key]?

python
dict-get
error-handling
json

Strip HTML from strings in Python

python
html-stripping
beautifulsoup
xss

Timeout for python requests.get entire response

python
timeouts
requests
web-scraping

Finding what methods a Python object has

python
introspection
error-handling
methods

How can I make a dictionary (dict) from separate lists of keys and values?

python
zip-dict
memory-management
code-readability

Adding a method to an existing object instance in Python

python
dynamic-methods
code-maintenance
best-practices

How do I print the full NumPy array without truncation?

python
numpy
printoptions
data-structures

Join List of Lists in Python

python
flattening
itertools
performance

Secondary axis with twinx(): how to add to legend

python
matplotlib
data-visualization
legend

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