Wednesday, February 27, 2019

Python Seaborn Library

Meet Seaborn
Why Seaborn
  • Compliments and extend matplotlib
  • Work with NumPy, Pandas data frames
  • Makes default parameters in matplotlib easy
  • Built-in themes for data analysis and machine learning algorithms
  • Matplotlib vs Seaborn
  • Matplotlib
  • import matplotlib.pyplot as plt
    import pandas as pd
    
    fg, ax = plt.subplots()
    mydt = pd.read_csv("https://path/to/data.csv")
    
    ax.violinplot(mydt["axi_label"], vert=False)
    plt.show()
    
  • Seaborn
  • # Import the necessary libraries
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    mydt = sns.load_dataset("data")
    
    sns.violinplot(x = "axi_label", data=mydt)
    plt.show()
    

    No comments:

    Post a Comment