X4DS

Python & Julia port of codes in the following excellent R books (including exercises):

Tidyverse port also will be included.

Python Stack Julia Stack
Language Version v3.9 v1.6
Data
Processing
Basic
  • Pandas
  • StatsKit
  • Enhanced
  • PyJanitor
  • DataFramesMeta
  • Visualization Basic
  • Matplotlib
  • Seaborn
  • MakiE
  • AlgebraOfGraphics
  • Enhanced
  • Yellowbrick
  • Machine
    Learning
    Basic
  • Scikit-Learn
  • MLXtend
  • MLJ
  • Clustering
  • Probablistic
    Programming
    Basic
  • PyMC3
  • Bambi
  • Turing
  • Code Styles

    basics

    • use enumerate() rather than range(len())
    xs = range(3)
    
    # good
    for ind, x in enumerate(xs):
      print(f'{ind}: {x}')
    
    # bad
    for i in range(len(xs)):
      print(f'{i}: {xs[i]}')
    

    matplotlib

    • use Axes object rather than Figure object
    # good
    _, axes = plt.subplots(1, 2, constrained_layout=True)
    axes[0].plot(x1, y1)
    axes[1].hist(x2, y2)
    
    # bad
    plt.subplot(121)
    plt.plot(x1, y1)
    plt.subplot(122)
    plt.hist(x2, y2)
    
    • use set() method rather than set_*() method
    # good
    ax.set(xlabel='x', ylabel='y')
    
    # bad
    ax.set_xlabel('x')
    ax.set_ylabel('y')
    

    References

    style

    GitHub

    https://github.com/gitony0101/X4DS