I drew a heatmap with seaborn [Python]

I practiced drawing a heat map using experimental data.

Import of matplotlib, seaborn, pandas

import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns```
 Ready with the above code.
## Data reading

#### **`ec_am = pd.read_csv('./ec_am.csv')`**

Data is 6 rows and 10 columns スクリーンショット 2020-11-12 18.28.40.png

Creating a heat map

First, try without specifying any conditions.

heatmap1 = sns.heatmap(ec_am)


plt.savefig("heatmap1.png ")```
 ![heatmap1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/861630/0777c956-4f60-4010-1554-c4fb1abfce4e.png)
 Save the figure in png format named heatmap1 with plt.savefig ("heatmap1.png "). The save destination is the same file as the open jupyter notebook.

 Next, try various conditions.

#### **`heatmap2 = sns.heatmap(ec_am, yticklabels=False, cbar=False)`**
```heatmap(ec_am, yticklabels=False, cbar=False)

plt.savefig("heatmap2.png ")```
 ![heatmap2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/861630/e8b81fe8-7847-04c2-61a8-99a5988eff72.png)
 Specify Y-axis labels with yticklabels. Specify the color bar with cbar. If it is False, it disappears.


#### **`heatmap3 = sns.heatmap(ec_am, cmap="Wistia", annot=True, fmt="1.2f")`**

plt.savefig("heatmap3.png ")``` heatmap3.png Specify the color with cmap. Display the numerical value of the data with annot. Display up to the xth decimal place with fmt = "1.xf" (x is a positive integer). See beiz notes for color types.

heatmap4 = sns.heatmap(ec_am, cmap="Purples", annot=True, fmt="1.1f", linewidths=.5)


plt.savefig("heatmap4.png ")```
 ![heatmap4.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/861630/c30243fd-cce2-3058-f354-6724e90afffa.png)
 Draw lines between cells with linewidths (thickness 0.5 in this case).








Recommended Posts

I drew a heatmap with seaborn [Python]
I made a fortune with Python.
I made a daemon with Python
I made a character counter with Python
I tried a functional language with Python
What I did with a Python array
I made a Hex map with Python
I made a roguelike game with Python
I made a simple blackjack with Python
I made a configuration file with Python
I made a neuron simulator with Python
Heatmap with Python + matplotlib
I made a competitive programming glossary with Python
I made a weather forecast bot-like with Python.
I made a GUI application with Python + PyQt5
I made a Twitter fujoshi blocker with Python ①
I want to make a game with Python
[Python] I made a Youtube Downloader with Tkinter.
I want to write to a file with Python
I made a bin picking game with Python
I made a Mattermost bot with Python (+ Flask)
How to draw a vertical line on a heatmap drawn with Python seaborn
[Python, ObsPy] I drew a beach ball on the map with Cartopy + ObsPy.
I tried fp-growth with python
I tried scraping with Python
I learned Python with a beautiful girl at Paiza # 02
I made a Twitter BOT with GAE (python) (with a reference)
I learned Python with a beautiful girl at Paiza # 01
I made a Christmas tree lighting game with Python
I tried to draw a route map with Python
I made a net news notification app with Python
I made a Python3 environment on Ubuntu with direnv.
I want to work with a robot in python.
I made a LINE BOT with Python and Heroku
Make a fortune with Python
I tried to automatically generate a password with Python3
Create a heatmap with pyqtgraph
A memo that I touched the Datastore with python
I made a python text
[Python, ObsPy] I wrote a beach ball with Matplotlib + ObsPy
I tried gRPC with Python
I tried scraping with python
I made blackjack with Python.
Create a directory with python
I made wordcloud with Python.
I want to run a quantum computer with Python
[Introduction to system trading] I drew a Stochastic Oscillator with python and played with it ♬
I replaced the Windows PowerShell cookbook with a python script.
I made a simple typing game with tkinter in Python
I made a package to filter time series with python
I made a simple book application with python + Flask ~ Introduction ~
I made a puzzle game (like) with Tkinter in Python
I tried a stochastic simulation of a bingo game with Python
[Python] What is a with statement?
Solve ABC163 A ~ C with Python
Operate a receipt printer with python
I made a Line-bot using Python!
Let's make a GUI with python.
Solve ABC166 A ~ D with Python
I tried web scraping with python.
Create a virtual environment with Python!