Explain Codes LogoExplain Codes Logo

Python

Pylint "unresolved import" error in Visual Studio Code

python
import-error
vscode-settings
python-configuration

How to display a float with two decimal places?

python
formatting
floats
pythonic

What is the maximum recursion depth, and how to increase it?

python
recursion-depth
performance
best-practices

How to POST JSON data with Python Requests?

python
requests
json
http-requests

How do I update Anaconda?

python
conda
package-management
environment-management

In Python, how do I determine if an object is iterable?

python
iterable
collections
iterators

A weighted version of random.choice

python
numpy
random-choice
weighted-random-choice

Selecting distinct column values in SQLAlchemy/Elixir

python
sqlalchemy
database-queries
distinct-values

How do I check if a list is empty?

python
best-practices
pythonic
efficiency

How to call a shell script from python code?

python
subprocess
shell-script
process-management

Substitute multiple whitespace with single whitespace in Python

python
functions
performance
best-practices

How do I call a function from another .py file?

python
importlib
python-imports
module-importation

Clear terminal in Python

python
terminal-management
escape-sequences
subprocess

Disable Tensorflow debugging information

python
logging
tensorflow
best-practices

How to use "get_or_create()" in Django?

python
django
get_or_create
tuple

Calling a function of a module by using its name (a string)

python
dynamic-invocation
getattr
importlib

Getting a map() to return a list in Python 3.x

python
list-comprehension
map-function
performance-optimization

How do I check if a string represents a number (float or int)?

python
functions
best-practices
code-readability

How to make a class JSON serializable

python
json-serialization
custom-methods
object-serialization

Automatically create requirements.txt

python
pipreqs
requirements-txt
dependency-management