Merge pull request #766 from rishig2003/main

Added content for seaborn
pull/726/head
Ankit Mahato 2024-06-02 04:10:31 +05:30 zatwierdzone przez GitHub
commit 96f0ad1805
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 83 dodań i 1 usunięć

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 53 KiB

Wyświetl plik

@ -4,4 +4,6 @@
- [Introducing Matplotlib](matplotlib-introduction.md)
- [Bar Plots in Matplotlib](matplotlib-bar-plots.md)
- [Pie Charts in Matplotlib](matplotlib-pie-charts.md)
- [Line Charts in Matplotlib](matplotlib-line-plot.md)
- [Line Charts in Matplotlib](matplotlib-line-plots.md)
- [Introduction to Seaborn and Installation](seaborn-intro.md)
- [Getting started with Seaborn](seaborn-basics.md)

Wyświetl plik

@ -0,0 +1,39 @@
Seaborn helps you explore and understand your data. Its plotting functions operate on dataframes and arrays containing whole datasets and internally perform the necessary semantic mapping and statistical aggregation to produce informative plots. Its dataset-oriented, declarative API lets you focus on what the different elements of your plots mean, rather than on the details of how to draw them.
Heres an example of what seaborn can do:
```Python
# Import seaborn
import seaborn as sns
# Apply the default theme
sns.set_theme()
# Load an example dataset
tips = sns.load_dataset("tips")
# Create a visualization
sns.relplot(
data=tips,
x="total_bill", y="tip", col="time",
hue="smoker", style="smoker", size="size",
)
```
Below is the output for the above code snippet:
![Seaborn intro image](images/seaborn-basics1.png)
```Python
# Load an example dataset
tips = sns.load_dataset("tips")
```
Most code in the docs will use the `load_dataset()` function to get quick access to an example dataset. Theres nothing special about these datasets: they are just pandas data frames, and we could have loaded them with `pandas.read_csv()` or build them by hand. Many users specify data using pandas data frames, but Seaborn is very flexible about the data structures that it accepts.
```Python
# Create a visualization
sns.relplot(
data=tips,
x="total_bill", y="tip", col="time",
hue="smoker", style="smoker", size="size",
)
```
This plot shows the relationship between five variables in the tips dataset using a single call to the seaborn function `relplot()`. Notice how only the names of the variables and their roles in the plot are provided. Unlike when using matplotlib directly, it wasnt necessary to specify attributes of the plot elements in terms of the color values or marker codes. Behind the scenes, seaborn handled the translation from values in the dataframe to arguments that Matplotlib understands. This declarative approach lets you stay focused on the questions that you want to answer, rather than on the details of how to control matplotlib.

Wyświetl plik

@ -0,0 +1,41 @@
Seaborn is a Python data visualization library based on Matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.
## Seaborn Installation
Before installing Matplotlib, ensure you have Python installed on your system. You can download and install Python from the [official Python website](https://www.python.org/).
Below are the steps to install and setup Seaborn:
1. Open your terminal or command prompt and run the following command to install Seaborn using `pip`:
```bash
pip install seaborn
```
2. The basic invocation of `pip` will install seaborn and, if necessary, its mandatory dependencies. It is possible to include optional dependencies that give access to a few advanced features:
```bash
pip install seaborn[stats]
```
3. The library is also included as part of the Anaconda distribution, and it can be installed with `conda`:
```bash
conda install seaborn
```
4. As the main Anaconda repository can be slow to add new releases, you may prefer using the conda-forge channel:
```bash
conda install seaborn -c conda-forge
```
## Dependencies
### Supported Python versions
- Python 3.8+
### Mandatory Dependencies
- [numpy](https://numpy.org/)
- [pandas](https://pandas.pydata.org/)
- [matplotlib](https://matplotlib.org/)
### Optional Dependencies
- [statsmodels](https://www.statsmodels.org/stable/index.html) for advanced regression plots
- [scipy](https://scipy.org/) for clustering matrices and some advanced options
- [fastcluster](https://pypi.org/project/fastcluster/) for faster clustering of large matrices