Explain Codes LogoExplain Codes Logo

Python

Change column type in pandas

python
pandas
dataframe
type-conversion

Can Flask have optional URL parameters?

python
flask
optional-parameters
restful

Extract file name from path, no matter what the os/path format

python
filename-extraction
pathlib
cross-platform

How to install psycopg2 with "pip" on Python?

python
psycopg2
virtualenv
installation

How do I reverse a list or loop over it backwards?

python
list-reversal
memory-management
performance

Filter dict to contain only certain keys?

python
filtering
dictionary-comprehension
lambda

Get difference between two lists with Unique Entries

python
set-operations
list-comprehension
efficiency

What is the best way to remove accents (normalize) in a Python unicode string?

python
unicode
normalization
regex

What is a cross-platform way to get the home directory?

python
pathlib
file-operations
cross-platform

Class (static) variables and methods

python
class-variables
instance-attributes
descriptor-protocol

How do you round UP a number?

python
math
rounding
numpy

Best way to find the intersection of multiple sets?

python
set-operations
reduce
code-readability

How to use a different version of python during NPM install?

python
npm
version-management
virtual-environments

Decode HTML Entities in Python String?

python
html-entities
data-integrity
html-parser

Manually raising (throwing) an exception in Python

python
exception-handling
custom-exceptions
debugging

How do I pass a variable by reference?

python
mutable
immutable
best-practices

Split string with multiple delimiters in Python

python
string-splitting
regex
custom-function

How do I get the current time?

python
datetime
pytz
utc

What does the "yield" keyword do in Python?

python
yield
generators
itertools

Using Python's os.path, how do I go up one directory?

python
path-manipulation
cross-platform
reusable-functions