Skip to content

Instantly share code, notes, and snippets.

@ilfey
Created December 26, 2023 15:23
Show Gist options
  • Select an option

  • Save ilfey/f27f09ef723d26eabca5e19dff7bf0b2 to your computer and use it in GitHub Desktop.

Select an option

Save ilfey/f27f09ef723d26eabca5e19dff7bf0b2 to your computer and use it in GitHub Desktop.
My python vs code snippets
{
"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