Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
A deque is implemented via the circular queue data structure and it has O(1) time complexity appending from both ends.
Unlike list and tuple collections, a deque CANNOT be sliced!
Spark Issue: Pure Python Code Errors
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
This post collects some typical pure Python errors in PySpark applications.
Symptom 1
object has no attribute
Solution 1
Fix the attribute name.
Symptom 2
No such file or directory
Solution …
Profile Performance of Python Applications
Tips¶
cProfile
(implemented in C) is preferred overprofile
(implemented in Python).The profiler modules (
cProfile
andprofile
) and tools based on them (e.g.,%prun
and%%prun
for notebook) are designed to provide an execution profile for a given program, not for benchmarking purposes (for that, there istime
DataFrame Implementations in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
Alternatives to pandas for Small Data¶
- Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow as memory model. It is the best replacement of pandas for small data at this time. Notice that Polars support multithreading and lazy computation but it cannot handle data larger than memory at this time.
Tips on Pytorch-Lightning
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
PyTorch Lightning - Finding the best learning rate for your model
PyTorch Lightning - William Falcon
Practical Lighting Tips to Rank on Kaggle Image Challenges
PyTorch Lightning Flash
https://lightning-flash.readthedocs.io/en …
Tips on PyTorch
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Docker Images for PyTorch
- pytorch/pytorch:latest (official PyTorch image)
- dclong/jupyterhub-pytorch
PyTorch Tutorials
https://pytorch.org/tutorials/beginner/pytorch_with_examples.html
Initialize Weights and Biases
In general …