Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f98d6ac

Browse files
committed
Pandas
1 parent 4c18e17 commit f98d6ac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3182,7 +3182,7 @@ b 3 4
31823182

31833183
```python
31843184
<DF> = <DF>.set_index(column_key) # Replaces row keys with values from a column.
3185-
<DF> = <DF>.reset_index() # Moves row keys to their own column.
3185+
<DF> = <DF>.reset_index() # Moves row keys to column named index.
31863186
<DF> = <DF>.filter('<regex>', axis=1) # Only keeps columns whose key matches the regex.
31873187
<DF> = <DF>.melt(id_vars=column_key/s) # Converts DF from wide to long format.
31883188
```

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2710,7 +2710,7 @@
27102710
&lt;DF&gt; = &lt;DF&gt; +-*/ &lt;el/Sr/DF&gt; <span class="hljs-comment"># Items with non-matching keys get value NaN.</span>
27112711
</code></pre>
27122712
<pre><code class="python language-python hljs">&lt;DF&gt; = &lt;DF&gt;.set_index(column_key) <span class="hljs-comment"># Replaces row keys with values from a column.</span>
2713-
&lt;DF&gt; = &lt;DF&gt;.reset_index() <span class="hljs-comment"># Moves row keys to their own column.</span>
2713+
&lt;DF&gt; = &lt;DF&gt;.reset_index() <span class="hljs-comment"># Moves row keys to column named index.</span>
27142714
&lt;DF&gt; = &lt;DF&gt;.filter(<span class="hljs-string">'&lt;regex&gt;'</span>, axis=<span class="hljs-number">1</span>) <span class="hljs-comment"># Only keeps columns whose key matches the regex.</span>
27152715
&lt;DF&gt; = &lt;DF&gt;.melt(id_vars=column_key/s) <span class="hljs-comment"># Converts DF from wide to long format.</span>
27162716
</code></pre>

0 commit comments

Comments
 (0)