Explain Codes LogoExplain Codes Logo

Python

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

How to display pandas DataFrame of floats using a format string for columns?

python
pandas
dataframe
formatting

What does functools.wraps do?

python
decorators
functools
debugging

Creating a new dictionary in Python

python
dictionaries
comprehensions
defaultdict

What is the Python 3 equivalent of "python -m SimpleHTTPServer"

python
http-server
local-development
ipv6

Are dictionaries ordered in Python 3.6+?

python
dictionaries
ordered-dict
memory-usage

Python string.replace regular expression

python
regex
string-manipulation
file-handling

Replacements for switch statement in Python?

python
switch-alternatives
match-case
control-structures

How can I check for NaN values?

python
nan
pandas
dataframe