Created
December 26, 2023 15:23
-
-
Save ilfey/f27f09ef723d26eabca5e19dff7bf0b2 to your computer and use it in GitHub Desktop.
My python vs code snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Create function" : { | |
| "prefix": "df", | |
| "body": [ | |
| "def $1($2):", | |
| "\t$3" | |
| ] | |
| }, | |
| "Create method": { | |
| "prefix": "dm", | |
| "body": [ | |
| "def $1(self, $2):", | |
| "\t$3" | |
| ] | |
| }, | |
| "Import numpy, pandas, matplot lib": { | |
| "prefix": "npm", | |
| "body": [ | |
| "import numpy as np", | |
| "import pandas as pd", | |
| "import matplotlib.pyplot as plt", | |
| "", | |
| "", | |
| "", | |
| ] | |
| }, | |
| "Draw gray plot": { | |
| "prefix": "plot-gray", | |
| "body": [ | |
| "plt.plot(${1:x}, ${2:y}, marker='.', mec='black', mfc='black', color='gray', mew=5, label='${3:f(x)}')", | |
| "", | |
| "plt.xlabel('${4:x}')", | |
| "plt.ylabel('${5:x}')", | |
| "", | |
| "plt.title('${6:title}')", | |
| "plt.legend()", | |
| "", | |
| "plt.show()", | |
| "", | |
| "$0", | |
| ] | |
| }, | |
| "Draw gray plot": { | |
| "prefix": "plot", | |
| "body": [ | |
| "plt.plot(${1:x}, ${2:y}, marker='.', mew=5, label='${3:f(x)}')", | |
| "", | |
| "plt.xlabel('${4:x}')", | |
| "plt.ylabel('${5:x}')", | |
| "", | |
| "plt.title('${6:title}')", | |
| "plt.legend()", | |
| "", | |
| "plt.show()", | |
| "", | |
| "$0", | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment