Explain Codes LogoExplain Codes Logo

Python

Pythonic way to avoid "if x: return x" statements

python
best-practices
functions
performance

Pandas: Setting the number of maximum rows

python
dataframe
display-options
pandas

How to extract text from a PDF file?

python
pdf-extraction
python-libraries
text-extraction

Apt command line interface-like yes/no input?

python
prompt-engineering
functions
best-practices

Why does "bytes(n)" create a length n byte string instead of converting n to a binary representation?

python
byte-literals
byte-sequences
python-versions

What is an alternative to execfile in Python 3?

python
execfile
python-3
script-execution

How do I trim whitespace?

python
functions
best-practices
dataframe

Apply pandas function to column to create multiple new columns?

python
pandas
dataframe
vectorized-solutions

How to execute multi-line statements within Python's own debugger (PDB)

python
prompt-engineering
debugging
pdb

Error "filename.whl is not a supported wheel on this platform"

python
pip-install
python-versions
wheel-file-handling

Python pandas to_sql with sqlalchemy: how to speed up exporting to MS SQL?

python
to_sql
sqlalchemy
performance

How to change dataframe column names in PySpark?

python
pandas
dataframe
renaming

Which is the preferred way to concatenate a string in Python?

python
string-concatenation
performance
best-practices

Reverse / invert a dictionary mapping

python
dataframe
defaultdict
pythonic

Shuffling a list of objects

python
shuffle
random
list

Assign output of os.system to a variable and prevent it from being displayed on the screen

python
subprocess
process-management
error-handling

How to add to the PYTHONPATH in Windows, so it finds my modules/packages?

python
environment-variables
pythonpath
path-manipulation

Multiple functions on multiple groupby columns – The Mastery

python
dataframe
lambda
best-practices

How to combine multiple QuerySets in Django?

python
prompt-engineering
interview-preparation
best-practices

Pretty printing XML in Python

python
pretty-printing
xml
elementtree