python

  • 2024
  • 29. Mar 2024 python: read files in parallel and merge them
  • Given an iterable of csv files, pandas read and concatenate them import pandas as pd from multiprocessing import Pool files = folderPath.glob('*.csv') with Pool() as pool: df = pd.concat(pool.

  • 14. Apr 2024 python: line by line profiling (time, memory)
  • Line-By-Line Profiling with %lprun pip install line_profiler In notebook %load_ext line_profiler %lprun -f slow_func slow_func(value) Timer unit: 1e-09 s Total time: 0.000134558 s File: /tmp/ipykernel

  • 16. Sep 2024 python code checks
  • Some code checks I do while reviewing python code.

    Using [] instead of generator expressions grep -rn –exclude-dir=venv –include="*.py" '(sum|min|max|any|all|list|tuple|set)(\


  • 17. Sep 2024 python environments
  • Use pyenv to switch between Python versions. Use venv for creating of virtual environments. pyenv versions pyenv version python –version # install a version pyenv install 3.10 # select just for curr

  • 2021
  • 10. Mar 2021 Using Django in Jupyter Notebook
  • To explore your Django models in Jupyter Notebook, you can use the following setup. Install django-extensions pip install django-extensions Include django-extensions in your settings INSTALLED_APPS

  • 2020
  • 09. Aug 2020 Compare ImageNet CNN architectures
  • Last week, I released a beginner’s utility to compare classification results from SotA Convolutional Neural Network architectures. Motivation for the tool was to enable beginners and non-program

  • 2019
  • 04. Sep 2019 Bar Chart Race in Python with Matplotlib
  • ~In roughly less than 50 lines of code Republished on towardsdatascience Bar chart races have been around for a while. This year, they took social media by storm. It began with Matt Navarra’s tw