'Seaborn load_dataset
I am trying to get a grouped boxplot working using Seaborn as per the example
I can get the above example working, however the line:
tips = sns.load_dataset("tips")
is not explained at all. I have located the tips.csv file, but I can't seem to find adequate documentation on what load_dataset specifically does. I tried to create my own csv and load this, but to no avail. I also renamed the tips file and it still worked...
My question is thus:
Where is load_dataset actually looking for files? Can I actually use this for my own boxplots?
EDIT: I managed to get my own boxplots working using my own DataFrame, but I am still wondering whether load_dataset is used for anything more than mysterious tutorial examples.
Solution 1:[1]
Just to add to 'selwyth's' answer.
import pandas as pd
Data=pd.read_csv('Path\to\csv\')
Data.head(10)
Once you have completed these steps successfully. Now the plotting actually works like this.
Let's say you want to plot a bar plot.
sns.barplot(x=Data.Year,y=Data.Salary) //year and salary attributes were present in my dataset.
This actually works with every plotting in seaborn.
Moreover, we will not be eligible to add our own dataset on Seaborn Git.
Solution 2:[2]
Download all csv files(zipped) to be used for your example from here.
Extract the zip file to a local directory and launch your jupyter notebook from the same directory. Run the following commands in jupyter notebook:
import pandas as pd
tips = pd.read_csv('seaborn-data-master/tips.csv')
you're good to work with your example now!
Solution 3:[3]
You will need to have an internet connection since the csv files are not on your local computer so your computer needs to be online in order to download the dataset
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | vegetarianCoder |
| Solution 2 | Rahul Deshmukh |
| Solution 3 | Tabot Charles Bessong |
