Skip to content

Commit 2597b76

Browse files
Initial commit
0 parents  commit 2597b76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+486
-0
lines changed

Default.sublime-commands

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"caption": "Python Data Science Snippets: Open Readme",
4+
"command": "open_file",
5+
"args": {
6+
"file": "${packages}/Python Data Science Snippets/README.md"
7+
}
8+
}
9+
]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 futureprogrammer360
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# 📊 Python Data Science Snippets
2+
3+
[Python Data Science Snippets](https://github.com/futureprogrammer360/Python-Data-Science-Snippets) is a collection of [Sublime Text](https://www.sublimetext.com/) snippets for data science and machine learning in Python.
4+
5+
## 💻 Installation
6+
7+
The easiest way to install Python Data Science Snippets is through [Package Control](https://packagecontrol.io/packages/Python%20Data%20Science%20Snippets). After it is enabled inside Sublime Text, open the command palette and find **Package Control: Install Package** and press `ENTER`. Then, find **Python Data Science Snippets** in the list. Press `ENTER` again, and this package is installed!
8+
9+
## 📈 Snippets
10+
11+
* [Imports](#imports)
12+
* [NumPy](#numpy)
13+
* [Pandas](#pandas)
14+
* [Matplotlib](#matplotlib)
15+
* [Scikit-learn](#scikit-learn)
16+
* [Keras](#keras)
17+
18+
### Imports
19+
20+
Import snippets start with `i` followed by the package's import alias.
21+
22+
| Trigger | Description |
23+
|------------|-----------------------------------|
24+
| `ikeras` | `from tensorflow import keras` |
25+
| `inp` | `import numpy as np` |
26+
| `ipd` | `import pandas as pd` |
27+
| `iplt` | `import matplotlib.pyplot as plt` |
28+
| `isklearn` | `from sklearn.$1 import $2` |
29+
| `isns` | `import seaborn as sns` |
30+
| `itf` | `import tensorflow as tf` |
31+
| `itorch` | `import torch` |
32+
33+
### NumPy
34+
35+
| Trigger | Description |
36+
|------------|----------------|
37+
| `arange` | `np.arange` |
38+
| `array` | `np.array` |
39+
| `linspace` | `np.linspace` |
40+
| `logspace` | `np.logspace` |
41+
| `ones` | `np.ones` |
42+
| `zeros` | `np.zeros` |
43+
44+
### Pandas
45+
46+
| Trigger | Description |
47+
|------------|----------------|
48+
| `columns` | `df.columns` |
49+
| `describe` | `df.describe` |
50+
| `df` | `pd.DataFrame` |
51+
| `head` | `df.head` |
52+
| `read_csv` | `pd.read_csv` |
53+
| `ser` | `pd.Series` |
54+
| `tail` | `df.tail` |
55+
56+
### Matplotlib
57+
58+
| Trigger | Description |
59+
|------------|----------------|
60+
| `bar` | `plt.bar` |
61+
| `legend` | `plt.legend` |
62+
| `pie` | `plt.pie` |
63+
| `plot` | `plt.plot` |
64+
| `scatter` | `plt.scatter` |
65+
| `show` | `plt.show` |
66+
| `subplots` | `plt.subplots` |
67+
| `title` | `plt.title` |
68+
| `xlabel` | `plt.xlabel` |
69+
| `ylabel` | `plt.ylabel` |
70+
71+
### Scikit-learn
72+
73+
| Trigger | Description |
74+
|----------|--------------------------|
75+
| `knn` | `KNeighborsClassifier` |
76+
| `linreg` | `LinearRegression` |
77+
| `logreg` | `LogisticRegression` |
78+
| `rfc` | `RandomForestClassifier` |
79+
| `tts` | `train_test_split` |
80+
81+
### Keras
82+
83+
| Trigger | Description |
84+
|--------------|---------------------------|
85+
| `compile` | `model.compile` |
86+
| `fit` | `model.fit` |
87+
| `layer` | `keras.layers.layer` |
88+
| `load_model` | `keras.models.load_model` |
89+
| `save` | `model.save` |
90+
| `sequential` | `keras.Sequential` |
91+
92+
The snippet files are in the `snippets` folder of [this GitHub repository](https://github.com/futureprogrammer360/Python-Data-Science-Snippets).

messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"install": "messages/install.txt"
3+
}

messages/install.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Hello fellow data scientist!
2+
3+
Thank you for installing the Python Data Science Snippets package. This is a collection of useful snippets for data science and machine learning in Python.
4+
5+
To see the snippets available, check out the README.md file via the `Python Data Science Snippets: Open Readme` command in command palette.
6+
7+
Enjoy!
8+
9+
GitHub homepage: https://github.com/futureprogrammer360/Python%20Data%20Science%20Snippets
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<content><![CDATA[
3+
from tensorflow import keras
4+
]]></content>
5+
<tabTrigger>ikeras</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>from tensorflow import keras</description>
8+
</snippet>

snippets/imports/np.sublime-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+
import numpy as np
4+
]]></content>
5+
<tabTrigger>inp</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>import numpy as np</description>
8+
</snippet>

snippets/imports/pd.sublime-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+
import pandas as pd
4+
]]></content>
5+
<tabTrigger>ipd</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>import pandas as pd</description>
8+
</snippet>

snippets/imports/plt.sublime-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+
import matplotlib.pyplot as plt
4+
]]></content>
5+
<tabTrigger>iplt</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>import matplotlib.pyplot as plt</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+
from sklearn.${1:model_selection} import ${2:train_test_split}
4+
]]></content>
5+
<tabTrigger>isklearn</tabTrigger>
6+
<scope>source.python</scope>
7+
<description>from sklearn.$1 import $2</description>
8+
</snippet>

0 commit comments

Comments
 (0)