File size: 1,722 Bytes
c745b43 e3fb687 fc5cf35 e3fb687 fc5cf35 c745b43 abe090b 4d8fc44 abe090b 4d8fc44 e3fb687 c745b43 02a9aa1 abe090b 02a9aa1 c745b43 e3fb687 c745b43 abe090b 4d8fc44 e3fb687 abe090b c745b43 4d8fc44 c745b43 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
[
{
"name": "Hello World!",
"value": "def print_hello_world():\n \"\"\"Print 'Hello World!'.\"\"\"",
"length": 8
},
{
"name": "Scikit-Learn",
"value": "import numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\n\n# create training data\nX = np.random.randn(100, 100)\ny = np.random.randint(0, 1, 100)\n\n# setup train test split",
"length": 52
},
{
"name": "Transformers",
"value": "from transformers import AutoTokenizer, AutoModelForSequenceClassification\n\n# build a BERT classifier",
"length": 48
},
{
"name": "Count words",
"value": "def count_words(filename):\n \"\"\"Count the number of occurrences of each word in the file\"\"\"",
"length": 48
},
{
"name": "Is e in L",
"value": "def is_in_list(L, e):\n \"\"\"Find if list L contains the element e.\"\"\"",
"length": 32
},
{
"name": "unittest",
"value": "def is_even(value):\n \"\"\"Returns True if value is an even number.\"\"\"\n return value % 2 == 0\n\n# setup unit tests for is_even\nimport unittest",
"length": 52
},
{
"name": "Pizza Problem",
"value": "def exercise():\n \"\"\"Marie ordered one chicken meal that costs 12 dollars, and some boxes of pizza. Marie paid a total of 44 dollars. How many boxes of pizza did Marie order if each box costs 8 dollars?\"\"\"",
"length": 52
},
{
"name": "Pandas",
"value": "# load dataframe from csv\ndf = pd.read_csv(filename)\n\n# columns: \"age_group\", \"income\"\n# calculate average income per age group",
"length": 16
}
] |