๐คฒ pandas์ dataframe์ jupyter css ํ์ผ ์ฝ๋๋ฅผ ๊ณ ์น๊ฑฐ๋ ์ถ๊ฐํ๋ฉด ์ ๋ง์ ๋ง๊ฒ ๊พธ๋ฐ ์ ์๋ค! ๊ทธ ๊ณผ์ ์ ์๊ฐํด๋ด
- ์์ ํ -
๐คฒ jupyter notebook styling css ํ์ผ ์ด 2๊ฐ๋ฅผ ์์ ํ๋ค.
โ custom.css
โก style.min.css
๐คฒ custom.css
๐คฒ ์ค๋ช ์ ์ํ๋ฉด overriding๋๋ ๋์ผ๊ตฌ์กฐ code์ ์ต์ข of ์ต์ข ๋ณธ์ ์ ์ธํ ๋ ์ฐ๋ผ๋ ์๋ด๋ฌธ
๐คฒ .dataframe์ style.min์์ ์ฐพ์๋ ์์ด์(ctrl+F5 ๋จ์ถํค) custom.css์ ๊น๋ํ ์ผ๋ค.
.dataframe th{
background:#B7E0F0;
font-weight: 600;
border:3px solid white;
}
→ <th> tag๋ dataframe table์ ์ ๋ชฉ์ ํด๋นํ๋ cell๋ก, ์๊น์ ์ ํ๊ณ , 3px solid white cell ๊ฐ ๊ฒฝ๊ณ๋ฅผ ์ค์ . font-weight๋ฅผ ๋ถ๊ณผํด ์ข ๋ ๊ฐ์กฐ
๐คฒ style.min.css
.rendered_html tr,
.rendered_html th,
.rendered_html td {
text-align: right;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: 1px black solid !important;
}
div#notebook_panel {
margin: 0px;
padding: 0px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
height: 100%;
background-color: #33E9FF;
}
→ <td> tag๋ dataframe์์ ํ๋์ cell์ ์๋ฏธํ๋ฉฐ, ๊ฐ cell์ border color, width ์ค์ . ํน์ ๊ฒน์น ๊น๋ด !important ์ฐ์ ์์
→ #notebook panel์์ bgcolor ์ค์
→ ๊ทธ ์ธ์๋ code cell border & ์๊น ์ค์ ํจ
* ์ฐธ๊ณ ์ถ์ฒ) https://datadoctorblog.com/2020/11/14/Py-Jupyter-Notebook-Styling-02/
'Python > Pandas&Numpy' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
map & applymap & apply(for dataframe & Series) (1) | 2024.06.02 |
---|---|
Numpy fundamentals 2/2 (0) | 2023.01.16 |
pandas Tricks (Kevin by DataSchool) ์๋ฃ! COMPILATION (0) | 2022.04.18 |
pandas Tricks_14๐๐ป 'styling a dataframe' (Kevin by DataSchool) (0) | 2022.04.18 |
pandas Tricks_13๐๐ป 'change display options' (Kevin by DataSchool) (0) | 2022.04.17 |
๋๊ธ