- Seaborn Tutorial
- Seaborn - Home
- Seaborn - Introduction
- Seaborn - Environment Setup
- Importing Datasets and Libraries
- Seaborn - Figure Aesthetic
- Seaborn- Color Palette
- Seaborn - Histogram
- Seaborn - Kernel Density Estimates
- Visualizing Pairwise Relationship
- Seaborn - Plotting Categorical Data
- Distribution of Observations
- Seaborn - Statistical Estimation
- Seaborn - Plotting Wide Form Data
- Multi Panel Categorical Plots
- Seaborn - Linear Relationships
- Seaborn - Facet Grid
- Seaborn - Pair Grid
- Function Reference
- Seaborn - Function Reference
- Seaborn Useful Resources
- Seaborn - Quick Guide
- Seaborn - Useful Resources
- Seaborn - Discussion
Seaborn.get_data_home() method
The Seaborn.get_data_home() method is used to return a path to the cache directory for inbuilt datasets.
Once the path is returned, the directory is used by the load_dataset() method. If the argument of this method, data_home, is not provided; it will use a directory specified by the seaborn_data environment variable (if it exists) or otherwise default to an OS-appropriate user cache location.
Syntax
Following is the syntax of the get_data_home() method −
sns.get_data_home()
Parameters
This method takes no parameters
Return value
Upon calling thisd method just returns the path to the cache directory like mentioned above. This method is generally followed by the load_dataset() method since upon understanding which directory the user is located at, then the user can load the dataset and proceed with plotting plots.
Example
The working of this method is seen below. Upon calling the method as shown below. The following output is obtained.
import seaborn as sns import matplotlib.pyplot as plt path = sns.get_data_home() print(path)
Output
The path to the cache directory is obtained and in this case it is the following.
'/root/seaborn-data'
To Continue Learning Please Login
Login with Google