KEMBAR78
python for data science! #Datascience #Python | PDF
www.1stepgrow.com
SEABORN
PYTHON FOR
PYTHON FOR
DATA SCIENCE
DATA SCIENCE
CHEAT SHEET PART- 2
www.1stepgrow.com
>>> import pandas as pd
>>> import numpy as np
>>> uniform_data = np.random.rand(10, 12)
>>> data = pd.DataFrame({'x':np.arange(1,101),
'y':np.random.normal(0,4,100)})
Seaborn also offers built-in data sets:
>>> titanic = sns.load_dataset("titanic")
>>> iris = sns.load_dataset("iris")
Data
www.1stepgrow.com
>>> f, ax = plt.subplots(figsize=(5,6))
>>> sns.set()
>>> sns.set_style("whitegrid")
>>> sns.set_style("ticks",
{"xtick.major.size":8,
"ytick.major.size":8})
>>> sns.axes_style("whitegrid")
Create a figure and one subplot
(Re)set the seaborn default
Set the matplotlib parameters
Set the matplotlib parameters
Return a dict of params or use
with temporarily set of the style
Seaborn Style
Figure Aesthetics
www.1stepgrow.com
>>> sns.set_context("talk")
>>> sns.set_palette("husl",3)
>>> sns.set_palette(flatui)
>>> flatui = "#9b59b6", "#3498db",
"#95a5a6","#e74c3c","#34495e",
"#2ecc71"]
>>> sns.color_palette("husl")
>>> sns.set_context("notebook",
font_scale=1.5, rc=
{"lines.linewidth":2.5})
Set context to "talk"
Define the color palette
Set your own color palette
Use with with to temporarily set
palette
Set context to "notebook",
Scale font elements
andoverride param mapping
Seaborn styles
Context Functions
Color Palette
www.1stepgrow.com
Build your career story with
1stepGrow Academy
Follow 1stepGrow Academy
Save the Post
Share your Comments

python for data science! #Datascience #Python

  • 1.
    www.1stepgrow.com SEABORN PYTHON FOR PYTHON FOR DATASCIENCE DATA SCIENCE CHEAT SHEET PART- 2
  • 2.
    www.1stepgrow.com >>> import pandasas pd >>> import numpy as np >>> uniform_data = np.random.rand(10, 12) >>> data = pd.DataFrame({'x':np.arange(1,101), 'y':np.random.normal(0,4,100)}) Seaborn also offers built-in data sets: >>> titanic = sns.load_dataset("titanic") >>> iris = sns.load_dataset("iris") Data
  • 3.
    www.1stepgrow.com >>> f, ax= plt.subplots(figsize=(5,6)) >>> sns.set() >>> sns.set_style("whitegrid") >>> sns.set_style("ticks", {"xtick.major.size":8, "ytick.major.size":8}) >>> sns.axes_style("whitegrid") Create a figure and one subplot (Re)set the seaborn default Set the matplotlib parameters Set the matplotlib parameters Return a dict of params or use with temporarily set of the style Seaborn Style Figure Aesthetics
  • 4.
    www.1stepgrow.com >>> sns.set_context("talk") >>> sns.set_palette("husl",3) >>>sns.set_palette(flatui) >>> flatui = "#9b59b6", "#3498db", "#95a5a6","#e74c3c","#34495e", "#2ecc71"] >>> sns.color_palette("husl") >>> sns.set_context("notebook", font_scale=1.5, rc= {"lines.linewidth":2.5}) Set context to "talk" Define the color palette Set your own color palette Use with with to temporarily set palette Set context to "notebook", Scale font elements andoverride param mapping Seaborn styles Context Functions Color Palette
  • 5.
    www.1stepgrow.com Build your careerstory with 1stepGrow Academy Follow 1stepGrow Academy Save the Post Share your Comments