Skip to content

Commit 6da17e0

Browse files
Add some Matplotlib and Pandas snippets
1 parent e304ee6 commit 6da17e0

21 files changed

+174
-15
lines changed

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The easiest way to install Python Data Science Snippets is through [Package Cont
2323

2424
### Imports
2525

26-
Import snippets start with `i` followed by the package's import alias.
26+
Import snippets start with `i` followed by the package/module's import alias.
2727

2828
| Trigger | Description |
2929
|------------|-------------------------------------------|
@@ -63,6 +63,7 @@ Import snippets start with `i` followed by the package's import alias.
6363
| `head` | `df.head` |
6464
| `read_csv` | `pd.read_csv` |
6565
| `rename` | `df.rename` |
66+
| `reset_index` | `df.reset_index` |
6667
| `sample` | `df.sample` |
6768
| `ser` | `pd.Series` |
6869
| `tail` | `df.tail` |
@@ -71,18 +72,34 @@ Import snippets start with `i` followed by the package's import alias.
7172

7273
### Matplotlib
7374

74-
| Trigger | Description |
75-
|------------|----------------|
76-
| `bar` | `plt.bar` |
77-
| `legend` | `plt.legend` |
78-
| `pie` | `plt.pie` |
79-
| `plot` | `plt.plot` |
80-
| `scatter` | `plt.scatter` |
81-
| `show` | `plt.show` |
82-
| `subplots` | `plt.subplots` |
83-
| `title` | `plt.title` |
84-
| `xlabel` | `plt.xlabel` |
85-
| `ylabel` | `plt.ylabel` |
75+
| Trigger | Description |
76+
|----------------|--------------------|
77+
| `annotate` | `plt.annotate` |
78+
| `bar_label` | `plt.bar_label` |
79+
| `bar` | `plt.bar` |
80+
| `barh` | `plt.barh` |
81+
| `fill_between` | `plt.fill_between` |
82+
| `hist` | `plt.hist` |
83+
| `imread` | `plt.imread` |
84+
| `imsave` | `plt.imsave` |
85+
| `imshow` | `plt.imshow` |
86+
| `legend` | `plt.legend` |
87+
| `pie` | `plt.pie` |
88+
| `plot` | `plt.plot` |
89+
| `savefig` | `plt.savefig` |
90+
| `scatter` | `plt.scatter` |
91+
| `show` | `plt.show` |
92+
| `stackplot` | `plt.stackplot` |
93+
| `subplot` | `plt.subplot` |
94+
| `subplots` | `plt.subplots` |
95+
| `suptitle` | `plt.suptitle` |
96+
| `text` | `plt.text` |
97+
| `tight_layout` | `plt.tight_layout` |
98+
| `title` | `plt.title` |
99+
| `xlabel` | `plt.xlabel` |
100+
| `xlim` | `plt.xlim` |
101+
| `ylabel` | `plt.ylabel` |
102+
| `ylim` | `plt.ylim` |
86103

87104
### Scikit-learn
88105

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"install": "messages/install.txt",
33
"1.0.1": "messages/1.0.1.txt",
4-
"1.0.2": "messages/1.0.2.txt"
4+
"1.0.2": "messages/1.0.2.txt",
5+
"1.0.3": "messages/1.0.3.txt"
56
}

messages/1.0.3.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
v1.0.3
2+
3+
New snippets are added for Matplotlib and Pandas.
4+
To see the snippets, run the `Python Data Science Snippets: Open Readme` command in the command palette.
5+
Enjoy!
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.annotate(${1:text}, ${2:xy})
4+
]]></content>
5+
<tabTrigger>annotate</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.annotate</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.bar_label(${1:container})
4+
]]></content>
5+
<tabTrigger>bar_label</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.bar_label</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.barh(${1:y}, ${2:width})
4+
]]></content>
5+
<tabTrigger>barh</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.barh</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.fill_between(${1:x}, ${2:y1}, ${3:y2})
4+
]]></content>
5+
<tabTrigger>fill_between</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.fill_between</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.hist(${1:x}, bins=${2:10})
4+
]]></content>
5+
<tabTrigger>hist</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.hist</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.imread(${1:fname})
4+
]]></content>
5+
<tabTrigger>imread</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.imread</description>
8+
</snippet>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
plt.imsave(${1:fname}, ${2:arr})
4+
]]></content>
5+
<tabTrigger>imsave</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>plt.imsave</description>
8+
</snippet>

0 commit comments

Comments
 (0)