Skip to content

Commit

Permalink
fix remove
Browse files Browse the repository at this point in the history
  • Loading branch information
luweizheng committed Sep 25, 2023
1 parent 32cc944 commit 15a1772
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 292 deletions.
12 changes: 6 additions & 6 deletions ch-pandas/dataframe-pivot-melt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@
"source": [
"## melt\n",
"\n",
"`melt()` 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。\n",
"`melt()` 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。根据其英文名,又可被理解成,将一个宽表,“融化”成一个长表。\n",
"\n",
"通过这种方式,可以将宽格式数据表格中的多列数据整合到一个列中,可以理解为透视表 `pivot_table()` 的反操作。\n"
]
Expand Down Expand Up @@ -1978,15 +1978,15 @@
"\n",
"我们回到 `melt()` 函数的参数。完整的参数形式为:`pandas.melt(frame, id_vars=None, value_vars=None, var_name=None, value_name='value', col_level=None)`。\n",
"\n",
"`frame` 指的是要进行重塑操作的 DataFrame 。\n",
"- `frame` 指的是要进行重塑操作的 DataFrame 。\n",
"\n",
"`id_vars` 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被 \"融化\"\n",
"- `id_vars` 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被融化\n",
"\n",
"`value_vars` 是需要 \"融化\" 的列,它们将被整合成一列,并用新的列名表示。\n",
"- `value_vars` 是需要融化的列,它们将被整合成一列,并用新的列名表示。\n",
"\n",
"`var_name` 用于存储 \"融化\" 后的列名的新列的名称\n",
"- `var_name` 用于存储融化后的列名的新列的名称\n",
"\n",
"`value_name` 用于存储 \"融化\" 后的值的新列的名称\n",
"- `value_name` 用于存储融化后的值的新列的名称\n",
"\n",
"```{figure} ../img/ch-pandas/melt.svg\n",
"---\n",
Expand Down
1 change: 0 additions & 1 deletion docs/_sources/ch-numpy copy/binary-ops.md

This file was deleted.

Empty file.
8 changes: 0 additions & 8 deletions docs/_sources/ch-numpy copy/index.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/_sources/ch-numpy copy/linalg.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/_sources/ch-numpy copy/ndarray-slicing-index.md

This file was deleted.

243 changes: 0 additions & 243 deletions docs/_sources/ch-numpy copy/ndarray.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/_sources/ch-numpy copy/numpy-intro.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/_sources/ch-numpy copy/random.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/_sources/ch-numpy copy/unary-ops.md

This file was deleted.

12 changes: 6 additions & 6 deletions docs/_sources/ch-pandas/dataframe-pivot-melt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@
"source": [
"## melt\n",
"\n",
"`melt()` 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。\n",
"`melt()` 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。根据其英文名,又可被理解成,将一个宽表,“融化”成一个长表。\n",
"\n",
"通过这种方式,可以将宽格式数据表格中的多列数据整合到一个列中,可以理解为透视表 `pivot_table()` 的反操作。\n"
]
Expand Down Expand Up @@ -1978,15 +1978,15 @@
"\n",
"我们回到 `melt()` 函数的参数。完整的参数形式为:`pandas.melt(frame, id_vars=None, value_vars=None, var_name=None, value_name='value', col_level=None)`。\n",
"\n",
"`frame` 指的是要进行重塑操作的 DataFrame 。\n",
"- `frame` 指的是要进行重塑操作的 DataFrame 。\n",
"\n",
"`id_vars` 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被 \"融化\"\n",
"- `id_vars` 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被融化\n",
"\n",
"`value_vars` 是需要 \"融化\" 的列,它们将被整合成一列,并用新的列名表示。\n",
"- `value_vars` 是需要融化的列,它们将被整合成一列,并用新的列名表示。\n",
"\n",
"`var_name` 用于存储 \"融化\" 后的列名的新列的名称\n",
"- `var_name` 用于存储融化后的列名的新列的名称\n",
"\n",
"`value_name` 用于存储 \"融化\" 后的值的新列的名称\n",
"- `value_name` 用于存储融化后的值的新列的名称\n",
"\n",
"```{figure} ../img/ch-pandas/melt.svg\n",
"---\n",
Expand Down
14 changes: 8 additions & 6 deletions docs/ch-pandas/dataframe-pivot-melt.html
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ <h3>数据筛选<a class="headerlink" href="#id3" title="Permalink to this headi
</div>
<div class="section" id="melt">
<h2>melt<a class="headerlink" href="#melt" title="Permalink to this heading">#</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">melt()</span></code> 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。</p>
<p><code class="docutils literal notranslate"><span class="pre">melt()</span></code> 是用于将一个很宽的的表转换为长。这个函数通常用于数据重塑(data reshaping)操作,以便更容易进行数据分析和可视化。根据其英文名,又可被理解成,将一个宽表,“融化”成一个长表。</p>
<p>通过这种方式,可以将宽格式数据表格中的多列数据整合到一个列中,可以理解为透视表 <code class="docutils literal notranslate"><span class="pre">pivot_table()</span></code> 的反操作。</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
Expand Down Expand Up @@ -1922,11 +1922,13 @@ <h2>melt<a class="headerlink" href="#melt" title="Permalink to this heading">#</
</div>
<p>数据重塑时,通常需要使用 <code class="docutils literal notranslate"><span class="pre">value_vars</span></code> 来指定需要 “融化” 的列,使它们被整合为一列。比如本例中,将 Math, English,History 整合为一列: Subject 列。</p>
<p>我们回到 <code class="docutils literal notranslate"><span class="pre">melt()</span></code> 函数的参数。完整的参数形式为:<code class="docutils literal notranslate"><span class="pre">pandas.melt(frame,</span> <span class="pre">id_vars=None,</span> <span class="pre">value_vars=None,</span> <span class="pre">var_name=None,</span> <span class="pre">value_name='value',</span> <span class="pre">col_level=None)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">frame</span></code> 指的是要进行重塑操作的 DataFrame 。</p>
<p><code class="docutils literal notranslate"><span class="pre">id_vars</span></code> 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被 “融化”。</p>
<p><code class="docutils literal notranslate"><span class="pre">value_vars</span></code> 是需要 “融化” 的列,它们将被整合成一列,并用新的列名表示。</p>
<p><code class="docutils literal notranslate"><span class="pre">var_name</span></code> 用于存储 “融化” 后的列名的新列的名称。</p>
<p><code class="docutils literal notranslate"><span class="pre">value_name</span></code> 用于存储 “融化” 后的值的新列的名称。</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">frame</span></code> 指的是要进行重塑操作的 DataFrame 。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">id_vars</span></code> 表示需要保留的列,它们将成为长表中的行;这些列又被称为标识变量(identifier variable),不被融化。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">value_vars</span></code> 是需要融化的列,它们将被整合成一列,并用新的列名表示。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">var_name</span></code> 用于存储融化后的列名的新列的名称。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">value_name</span></code> 用于存储融化后的值的新列的名称。</p></li>
</ul>
<div class="figure align-default" id="melt-img">
<img alt="../_images/melt.svg" src="../_images/melt.svg" /><p class="caption"><span class="caption-number">Fig. 3 </span><span class="caption-text">melt(): 数据融化</span><a class="headerlink" href="#melt-img" title="Permalink to this image">#</a></p>
</div>
Expand Down
18 changes: 18 additions & 0 deletions docs/datasets/sales/sales.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Account,Name,Rep,Manager,Product,Quantity,Price,Status
714466,Trantow-Barrows,Craig Booker,Debra Henley,CPU,1,30000,presented
714466,Trantow-Barrows,Craig Booker,Debra Henley,Software,1,10000,presented
714466,Trantow-Barrows,Craig Booker,Debra Henley,Maintenance,2,5000,pending
737550,"Fritsch, Russel and Anderson",Craig Booker,Debra Henley,CPU,1,35000,declined
146832,Kiehn-Spinka,Daniel Hilton,Debra Henley,CPU,2,65000,won
218895,Kulas Inc,Daniel Hilton,Debra Henley,CPU,2,40000,pending
218895,Kulas Inc,Daniel Hilton,Debra Henley,Software,1,10000,presented
412290,Jerde-Hilpert,John Smith,Debra Henley,Maintenance,2,5000,pending
740150,Barton LLC,John Smith,Debra Henley,CPU,1,35000,declined
141962,Herman LLC,Cedric Moss,Fred Anderson,CPU,2,65000,won
163416,Purdy-Kunde,Cedric Moss,Fred Anderson,CPU,1,30000,presented
239344,Stokes LLC,Cedric Moss,Fred Anderson,Maintenance,1,5000,pending
239344,Stokes LLC,Cedric Moss,Fred Anderson,Software,1,10000,presented
307599,"Kassulke, Ondricka and Metz",Wendy Yule,Fred Anderson,Maintenance,3,7000,won
688981,Keeling LLC,Wendy Yule,Fred Anderson,CPU,5,100000,won
729833,Koepp Ltd,Wendy Yule,Fred Anderson,CPU,2,65000,declined
729833,Koepp Ltd,Wendy Yule,Fred Anderson,Monitor,2,5000,presented
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 15a1772

Please sign in to comment.