-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathPython_intro_hackathon.sublime-workspace
659 lines (659 loc) · 32.4 KB
/
Python_intro_hackathon.sublime-workspace
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
{
"auto_complete":
{
"selected_items":
[
[
"text",
"text_size_change"
],
[
"get",
"getElementById"
],
[
"butt",
"button_text_to_change"
],
[
"button",
"button1"
],
[
"m",
"myImage"
],
[
"on",
"onclick Attr"
],
[
"name",
"name"
],
[
"format",
"formattedRole"
],
[
"formatted",
"formattedName"
],
[
"fun",
"funThoughts"
],
[
"For",
"ForeignKey"
],
[
"resta",
"restaurant"
],
[
"nu",
"nullable"
],
[
"cre",
"create_engine"
],
[
"dec",
"declarative_base"
]
]
},
"buffers":
[
{
"contents": "\ntitle : Python Libraries and data structures\ndescription : In this chapter, we will take you through the libraries we commonly use in data analysis and introduce some of the most common data structures to you.\nattachments :\n slides_link : https://s3.amazonaws.com/assets.datacamp.com/course/teach/slides_example.pdf\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:af2f6f90f3\n## Create a list\n\nList is one of the most versatile data structure in Python. A list can simply be defined by writing a list of comma separated values in square brackets. Lists might contain items of different types. Python lists are mutable and individual elements of a list can be changed.\n\n```{python}\nCountry =['INDIA','USA','GERMANY','UK','AUSTRALIA']\n\nTemperature =[44, 28, 20, 18, 25, 45, 67]\n```\nWe just created two lists, one for Country names and other one for temperature. \n\n####Accessing individual elements of a list\n- Individual elements of a list can be accessed by writting an index number in square bracket. First index of list starts with 0 (zero) not 1.\n- A range of element can be accessed by having start index and end index but it does not return the value available at end index,\n\n*** =instructions\n- Create a list of first five odd numbers and store it in a variable odd_numbers.\n- Print second to fourth element [1, 4, 9] from squares_lis,t\n\n\n*** =hint\n- Use AV[0] to select the first element of a list AV. \n- Use AV[1:3] to select second to third element of a list AV.\n\n\n*** =pre_exercise_code\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n```\n\n*** =sample_code\n\n```{python}\n\n# Create a list of squared numbers\nsquares_list = [0, 1, 4, 9, 16, 25]\n\n# Now write a code to create list of first five odd numbers and store it into a variable odd_numbers\nodd_numbers=\n\n# Print first element of squares_list\nprint (squares_list[0])\n\n# Print second to fourth elements of squares_list\n\n```\n\n*** =solution\n```{python}\n\n# Create a list of squared numbers\nsquares_list = [0, 1, 4, 9, 16, 25]\n\n# Now write a code to create list of first five odd numbers and store it into a variable odd_numbers\nodd_numbers = [1, 3, 5, 7, 9]\n\n# Print first element of squares_list\nprint (squares_list[0])\n\n# Print second to fourth elements of squares_list\nprint (squares_list[1:4])\n```\n\n*** =sct\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Test for list of odd_numbers\ntest_object(\"odd_numbers\")\n\n# Check second to fourth elements\"\ntest_output_contains(\"[1, 4, 9]\", pattern = False)\nsuccess_msg(\"Great work!\")\n```\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:c7f91e389f\n## Create a String\n\nStrings can simply be defined by use of single ( ‘ ), double ( ” ) or triple ( ”’ ) inverted commas. Strings enclosed in triple quotes ( ”’ ) can span over multiple lines. Please note that Python strings are immutable, so you can not change part of strings.\n\n```{python}\nString =\" Strings elements can also be accessed using index number like list\"\n\nprint (String[0:8])\n\n#Above print command display Strings on screen.\n\n```\n\n\n*** =instructions\n\n- len function returns the lenght of string\n- Strings characters can be accessed using index number (similar like list)\n- Strings can be concatenated with other strings using '+' operator\n\n\n\n*** =hint\n\n- Use str[2] to select the third element of string str \n- Use len(str) to return the length of string\n- Use str1 + str2 to return the concatenated result of both strings str1 and str2\n\n\n\n*** =pre_exercise_code\n\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n```\n\n*** =sample_code\n\n```{python}\n# Create a string str\nstr1 = \"Introduction with strings\"\n\n# Now store the length of string in varible str_len \nstr_len =\n\n# Print last seven characters of strings str\n\n\nstr1 = \"I am doing a course Introduction to Hackathon using \"\nstr2 = \"Python\"\n\n# Write a code to store concatenated string of str1 and str2 into variable str3\nstr3 =\n\n```\n\n*** =solution\n\n```{python}\n\n# Create a string str\nstr1 = \"Introduction with strings\"\n\n# Now store the length of string in varible str_len \nstr_len=len(str1)\n\n# Print last seven characters of strings str\nprint (str1[18:25])\n\nstr1 = \"I am doing a course Introduction to Hackathon using \"\nstr2 = \"Python\"\n\n# Write a code to store concatenated string of str1 and str2 into variable str3\nstr3= str1 + str2\n```\n\n*** =sct\n\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Check length of strings\ntest_object(\"str_len\")\n\n# Check last seven characters\ntest_output_contains(\"strings\", pattern = False)\n\n# Check concatenated strings\"\ntest_object(\"str3\")\nsuccess_msg(\"Great work!\")\n```\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:377e9324f2\n## Create a Dictionary\n\nDictionary is an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary). A pair of braces creates an empty dictionary: {}.\n\n```{python}\nDICT = {'Name':'Kunal', 'Company':'Analytics Vidhya'}\n\n#Dictionary elements can be accessed by \"keys\"\n\nprint (DICT['Name'])\n\n#Above print statement will print Kunal\n\n```\n\nIn dictonary \"DICT\", Name and Company are dictionary keys where as \"Kunal\" and \"Analytics Vidhya\" are values.\n\n*** =instructions\n\n- To access dictionary elements, you can use the familiar square brackets along with the key to obtain its value\n- Dictionary can be updated by adding a new entry or a key-value pair, modifying or deleting an existing entry\n\n*** =hint\n\n- Use dict['Keys'] = new_value to update the existing value\n- Use dict.keys() to access all keys of dictionary dict\n- Use dict.values() to access all values of dictionary dict\n\n\n*** =pre_exercise_code\n\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n```\n\n*** =sample_code\n\n```{python}\n\n# Create a dictionary\ndict1 = {'Name': 'Max', 'Age': 16, 'Sports': 'Cricket'}\n\n# Update the value of Age to 18\n\n\n# Print the value of Age\n\n\n# Print all the keys of dictionary dict1\n\n\n```\n\n*** =solution\n\n```{python}\n\n# Create a dictionary\ndict1 = {'Name': 'Max', 'Age': 16, 'Sports': 'Cricket'}\n\n# Update the value of Age to 18\ndict1['Age'] = 18\n\n# Print the value of Age\nprint (dict1['Age'])\n\n# Print all the keys of dictionary dict\nprint (dict1.keys())\n\n```\n\n*** =sct\n\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Check value of Age\ntest_output_contains(\"18\", pattern = False)\n\n# Check keys of dictionary\ntest_output_contains(\"dict_keys(['Name', 'Age', 'Sports'])\", pattern = False)\n\nsuccess_msg(\"Great work!\")\n```\n\n--- type:MultipleChoiceExercise lang:python xp:50 skills:1 key:9a8fd577a9\n## Why python libraries are useful?\n\nLets take one step ahead in our journey to learn Python by getting acquainted with some useful libraries. The first step is obviously to learn to import them into our environment. There are several ways of doing so in Python:\n\n```{python}\nimport math as m\n\nfrom math import *\n```\n\nIn the first manner, we have defined an alias m to library math. We can now use various functions from math library (e.g. factorial) by referencing it using the alias m.factorial().\n\nIn the second manner, you have imported the entire name space in math i.e. you can directly use factorial() without referring to math.\n\nFollowing are a list of libraries, you will need for any scientific computations and data analysis:\n\n* <a href=\"http://www.numpy.org/\"> Numpy </a>\n* <a href=\"https://www.scipy.org/\"> Scipy </a>\n* <a href=\"http://pandas.pydata.org/pandas-docs/stable/\"> Pandas </a>\n* <a href=\"http://matplotlib.org/\"> Matplotlib </a>\n* <a href=\"http://scikit-learn.org/\"> Scikit Learn </a>\n\n\n\n##### Which of the following is a valid import statement for below code?\n```{python}\nprint (factorial(5))\n```\n\n*** =instructions\n- import math\n- from math import factorial\n- import math.factorial\n\n*** =hint\nPython's from statement lets you import specific attributes from a module into the current namespace.\n\n*** =pre_exercise_code\n\n\n*** =sct\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package\n\nmsg_bad = \"Read about importing libraries in python\"\nmsg_success = \"Good Job!\"\n\n# Use test_mc() to grade multiple choice exercises. \n# Pass the correct option (Action, option 2 in the instructions) to correct.\n# Pass the feedback messages, both positive and negative, to feedback_msgs in the appropriate order.\ntest_mc(2, [msg_bad, msg_success, msg_bad]) \n```\n\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:50c9218dac\n## Why conditional statement is required?\n\nConditional statements, these are used to execute code fragments based on a condition. The most commonly used construct is if-else, with following syntax:\n\n```{python}\n\nif [condition]:\n __execution if true__\nelse:\n __execution if false__ \n```\n\n*** =instructions\n\n- Store the length of squares_list to square_len\n- Use the if statement to perform one action if one thing is true,or any other actions, if something else is true\n\n\n*** =hint\n\n- Use <, >, <=, >=, == and != for comparison\n- Use len(list) to return length of string\n\n\n*** =pre_exercise_code\n\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n```\n\n*** =sample_code\n\n```{python}\n# Create a two integer variables a and b\na=3\nb=4\n\n# if a is greater than b print a-b else a+b\nif a > b:\n print (a-b)\nelse:\n print (a+b)\n\n# Create a list of squared numbers\nsquares_list = [0, 1, 4, 9, 16, 25]\n\n# Store the length of squares_list in square_len\nsquare_len = \n\n# if square_len is less than 5 then print \"Less than 5\" else \"Greater than 5\"\nif square_len < ___:\n print (\"__________\")\nelse:\n print (\"__________\")\n\n\n```\n\n*** =solution\n\n```{python}\n# Create a two integer variables a and b\na=3\nb=4\n\n# if a is greater than b print a-b else a+b\nif a > b:\n print (a-b)\nelse:\n print (a+b)\n\n# Create a list of squared numbers\nsquares_list = [0, 1, 4, 9, 16, 25]\n\n# Store the length of squares_list in square_len\nsquare_len = len(squares_list)\n\n# if square_len is less than 5 then print \"Less than 5\" else \"Greater than 5\"\nif square_len < 5:\n print (\"Less than 5\")\nelse:\n print (\"Greater than 5\")\n\n```\n\n*** =sct\n\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Check length of strings\ntest_object(\"square_len\")\n\n# Check last seven characters\ntest_output_contains(\"Greater than 5\", pattern = False)\n\nsuccess_msg(\"Great work!\")\n```\n\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:c1b7c2fd5c\n## How iterative statement does help?\n\nComputers are often used to automate repetitive tasks. Repeating identical or similar tasks without making errors is something that computers do well. Repeated execution of a set of statements is called iteration.\n\nLike most languages, Python also has a FOR-loop which is the most widely used method for iteration. It has a simple syntax:\n\n```{python}\n\nfor i in [Python Iterable]:\n expression(i)\n\n```\n“Python Iterable” can be a list or other advanced data structures which we will explore in later sections. Let’s take a look at a simple example, determining the factorial of a number.\n\n*** =instructions\n\n- Use list.append(<element>) to append values in a list\n- Iterate over list to access each element of list\n\n\n\n*** =hint\n\n- Use <, >, <=, >=, == and != for comparison\n- Use len(list) to return length of string\n- % operator helps to return remainder e.g. 4 % 3 would be 1\n\n*** =pre_exercise_code\n\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n```\n\n*** =sample_code\n\n```{python}\n# Create a list with first five numbers\nls=[]\nfor x in range(5):\n ls.append(x)\n \nsum=0\n# Store sum all even numbers of the list ls in sum\n\nfor x in ls: \n if ______: \n sum += x\n\n```\n\n*** =solution\n\n```{python}\n# Create a list with first five numbers\nls=[]\nfor x in range(5):\n ls.append(x) # append a value to a list\n \nsum=0\n# Store sum all even numbers of the list ls in sum\n\nfor x in ls: \n if x%2==0: \n sum += x\n\n```\n\n*** =sct\n\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Check length of strings\ntest_object(\"sum\")\n\nsuccess_msg(\"Great work!\")\n```\n",
"file": "chapter2.md",
"file_size": 13909,
"file_write_time": 131096300693332037,
"settings":
{
"buffer_size": 13384,
"line_ending": "Windows"
}
},
{
"contents": "Analytics Vidhya\nAbout Us\nTeam\nCareers\n\n\nFor Data Scientists\nBlog\nDiscussions\nHackathons\nJobs\n",
"settings":
{
"buffer_size": 94,
"line_ending": "Windows",
"name": "Analytics Vidhya"
}
},
{
"file": "chapter7.md",
"settings":
{
"buffer_size": 7564,
"line_ending": "Windows"
}
},
{
"contents": "---\ntitle : Tips and Tricks from the best hackers!\ndescription : Here is the best part of a hackathon - you learn from the best hackers as you compete against them. This chapter just brings out some tips and tricks as shared by the best hackers.\nattachments :\n slides_link : https://s3.amazonaws.com/assets.datacamp.com/course/teach/slides_example.pdf\n\n--- type:VideoExercise lang:python xp:50 skills:1 key:c55198c91d\n## Analyze movie ratings\n\n*** =video_link\n//player.vimeo.com/video/154783078\n\n--- type:MultipleChoiceExercise lang:python xp:50 skills:1 key:9a8fd577a9\n## A really bad movie\n\nHave a look at the plot that showed up in the viewer to the right. Which type of movies have the worst rating assigned to them?\n\n*** =instructions\n- Long movies, clearly\n- Short movies, clearly\n- Long movies, but the correlation seems weak\n- Short movies, but the correlation seems weak\n\n*** =hint\nHave a look at the plot. Do you see a trend in the dots?\n\n*** =pre_exercise_code\n```{r}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n\n# 1. Pre-load packages, so that users don't have to do this manually.\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# 2. Preload a dataset. The code below will read the csv that is stored at the URL's location.\n# The movies variable will be available in the user's console.\nmovies = pd.read_csv(\"http://s3.amazonaws.com/assets.datacamp.com/course/introduction_to_r/movies.csv\")\n\n# 3. Create a plot in the viewer, that students can check out while reading the exercise\nplt.scatter(movies.runtime, movies.rating)\nplt.show()\n```\n\n*** =sct\n```{r}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package\n\nmsg_bad = \"That is not correct!\"\nmsg_success = \"Exactly! The correlation is very weak though.\"\n\n# Use test_mc() to grade multiple choice exercises. \n# Pass the correct option (Action, option 2 in the instructions) to correct.\n# Pass the feedback messages, both positive and negative, to feedback_msgs in the appropriate order.\ntest_mc(4, [msg_bad, msg_bad, msg_bad, msg_success]) \n```\n\n--- type:MultipleChoiceExercise lang:python xp:50 skills:1 key:f0e6a8e8a5\n## A really bad movie\n\nHave a look at the plot that showed up in the viewer to the right. Which type of movies have the worst rating assigned to them?\n\n*** =instructions\n- Long movies, clearly\n- Short movies, clearly\n- Long movies, but the correlation seems weak\n- Short movies, but the correlation seems weak\n\n*** =hint\nHave a look at the plot. Do you see a trend in the dots?\n\n*** =pre_exercise_code\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n\n# 1. Pre-load packages, so that users don't have to do this manually.\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# 2. Preload a dataset. The code below will read the csv that is stored at the URL's location.\n# The movies variable will be available in the user's console.\nmovies = pd.read_csv(\"http://s3.amazonaws.com/assets.datacamp.com/course/introduction_to_r/movies.csv\")\n\n# 3. Create a plot in the viewer, that students can check out while reading the exercise\nplt.scatter(movies.runtime, movies.rating)\nplt.show()\n```\n\n*** =sct\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the\n# pythonwhat Python package\n\nmsg_bad = \"That is not correct!\"\nmsg_success = \"Exactly! The correlation is very weak though.\"\n\n# Use test_mc() to grade multiple choice exercises.\n# Pass the correct option (option 4 in the instructions) to correct.\n# Pass the feedback messages, both positive and negative, to feedback_msgs in the appropriate order.\ntest_mc(4, [msg_bad, msg_bad, msg_bad, msg_success])\n```\n\n--- type:NormalExercise lang:python xp:100 skills:1 key:af2f6f90f3\n## Plot the movies yourself\n\nDo you remember the plot of the last exercise? Let's make an even cooler plot!\n\nA dataset of movies, `movies`, is available in the workspace.\n\n*** =instructions\n- The first function, `np.unique()`, uses the `unique()` function of the `numpy` package to get integer values for the movie genres. You don't have to change this code, just have a look!\n- Import `pyplot` in the `matplotlib` package. Set an alias for this import: `plt`.\n- Use `plt.scatter()` to plot `movies.runtime` onto the x-axis, `movies.rating` onto the y-axis and use `ints` for the color of the dots. You should use the first and second positional argument, and the `c` keyword.\n- Show the plot using `plt.show()`.\n\n*** =hint\n- You don't have to program anything for the first instruction, just take a look at the first line of code.\n- Use `import ___ as ___` to import `matplotlib.pyplot` as `plt`.\n- Use `plt.scatter(___, ___, c = ___)` for the third instruction.\n- You'll always have to type in `plt.show()` to show the plot you created.\n\n*** =pre_exercise_code\n```{python}\n# The pre exercise code runs code to initialize the user's workspace. You can use it for several things:\n\n# 1. Preload a dataset. The code below will read the csv that is stored at the URL's location.\n# The movies variable will be available in the user's console.\nimport pandas as pd\nmovies = pd.read_csv(\"http://s3.amazonaws.com/assets.datacamp.com/course/introduction_to_r/movies.csv\")\n\n# 2. Preload a package\nimport numpy as np\n```\n\n*** =sample_code\n```{python}\n# Get integer values for genres\n_, ints = np.unique(movies.genre, return_inverse = True)\n\n# Import matplotlib.pyplot\n\n\n# Make a scatter plot: runtime on x-axis, rating on y-axis and set c to ints\n\n\n# Show the plot\n\n```\n\n*** =solution\n```{python}\n# Get integer values for genres\n_, ints = np.unique(movies.genre, return_inverse = True)\n\n# Import matplotlib.pyplot\nimport matplotlib.pyplot as plt\n\n# Make a scatter plot: runtime on x-axis, rating on y-axis and set c to ints\nplt.scatter(movies.runtime, movies.rating, c=ints)\n\n# Show the plot\nplt.show()\n```\n\n*** =sct\n```{python}\n# The sct section defines the Submission Correctness Tests (SCTs) used to\n# evaluate the student's response. All functions used here are defined in the \n# pythonwhat Python package. Documentation can also be found at github.com/datacamp/pythonwhat/wiki\n\n# Check if the student changed the np.unique() call\n# If it's not called, we know the student removed the call.\n# If it's called incorrectly, we know the student changed the call.\ntest_function(\"numpy.unique\",\n not_called_msg = \"Don't remove the call of `np.unique` to define `ints`.\",\n incorrect_msg = \"Don't change the call of `np.unique` to define `ints`.\")\n# Check if the student removed the ints object\ntest_object(\"ints\",\n undefined_msg = \"Don't remove the definition of the predefined `ints` object.\",\n incorrect_msg = \"Don't change the definition of the predefined `ints` object.\")\n\n# Check if the student imported matplotlib.pyplot like the solution\n# Let automatic feedback message generation handle the feedback messages\ntest_import(\"matplotlib.pyplot\", same_as = True)\n\n# Check whether the student used the scatter() function correctly\n# If it's used, but incorrectly, tell them to check the instructions again\ntest_function(\"matplotlib.pyplot.scatter\",\n incorrect_msg = \"You didn't use `plt.scatter()` correctly, have another look at the instructions.\")\n\n# Check if the student called the show() function\n# Let automatic feedback message generation handle all feedback messages\ntest_function(\"matplotlib.pyplot.show\")\n\nsuccess_msg(\"Great work!\")\n```",
"file": "chapter6.md",
"file_size": 7859,
"file_write_time": 131091859011149763,
"settings":
{
"buffer_size": 7680,
"line_ending": "Windows"
}
},
{
"file": "chapter5.md",
"settings":
{
"buffer_size": 27307,
"line_ending": "Windows"
}
},
{
"file": "chapter4.md",
"settings":
{
"buffer_size": 9866,
"line_ending": "Windows"
}
},
{
"file": "chapter3.md",
"settings":
{
"buffer_size": 11549,
"line_ending": "Windows"
}
},
{
"file": "course.yml",
"settings":
{
"buffer_size": 708,
"line_ending": "Windows"
}
},
{
"file": "chapter1.md",
"settings":
{
"buffer_size": 6780,
"line_ending": "Windows"
}
},
{
"file": "README.md",
"settings":
{
"buffer_size": 1933,
"line_ending": "Windows"
}
},
{
"contents": "List of possible questions:\n\n1. Where can we host slides? Amazon only or could this be Slideshare or Dropbox as well?",
"settings":
{
"buffer_size": 117,
"line_ending": "Windows",
"name": "List of possible questions:"
}
}
],
"build_system": "",
"build_system_choices":
[
],
"build_varint": "",
"command_palette":
{
"height": 392.0,
"last_filter": "packa",
"selected_items":
[
[
"packa",
"Package Control: Install Package"
],
[
"",
"Package Control: Install Package"
]
],
"width": 512.0
},
"console":
{
"height": 126.0,
"history":
[
"import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)"
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"expanded_folders":
[
"/C/Users/lenovo/python_intro_hackathon"
],
"file_history":
[
"/C/Users/lenovo/python_intro_hackathon/chapter1.md",
"/C/Users/lenovo/Downloads/DYD_SEC.py",
"/C/Users/lenovo/Downloads/sub4/sub4/prepData.py",
"/C/Users/lenovo/Downloads/sub4/sub4/finalModel.py",
"/E/Kunal/GitHub/frontend-nanodegree-resume/Log in",
"/E/Kunal/GitHub/javascript_experiments/test.html",
"/E/Kunal/GitHub/frontend-nanodegree-resume/index.html",
"/E/Kunal/GitHub/frontend-nanodegree-resume/js/resumeBuilder.js",
"/E/Kunal/GitHub/frontend-nanodegree-resume/js/helper.js",
"/E/Kunal/GitHub/frontend-nanodegree-resume/js/jQuery.js",
"/E/Kunal/linux/vagrant_machine/python_code/database_setup.py",
"/E/Kunal/linux/vagrant_machine/python_code/lotsofmenus2.py",
"/E/Kunal/linux/vagrant_machine/python_code/fresh_tomatoes.py",
"/E/Kunal/linux/vagrant_machine/python_code/lotsofmenus.py"
],
"find":
{
"height": 23.0
},
"find_in_files":
{
"height": 0.0,
"where_history":
[
]
},
"find_state":
{
"case_sensitive": false,
"find_history":
[
"\";"
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": true,
"replace_history":
[
],
"reverse": false,
"show_context": true,
"use_buffer2": true,
"whole_word": false,
"wrap": true
},
"groups":
[
{
"selected": 1,
"sheets":
[
{
"buffer": 0,
"file": "chapter2.md",
"semi_transient": false,
"settings":
{
"buffer_size": 13384,
"regions":
{
},
"selection":
[
[
1357,
1357
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 1470.0,
"zoom_level": 1.0
},
"stack_index": 1,
"type": "text"
},
{
"buffer": 1,
"semi_transient": false,
"settings":
{
"buffer_size": 94,
"regions":
{
},
"selection":
[
[
94,
94
]
],
"settings":
{
"auto_name": "Analytics Vidhya",
"default_dir": "C:\\Users\\lenovo\\python_intro_hackathon",
"syntax": "Packages/Text/Plain text.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
},
{
"buffer": 2,
"file": "chapter7.md",
"semi_transient": false,
"settings":
{
"buffer_size": 7564,
"regions":
{
},
"selection":
[
[
132,
132
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 10,
"type": "text"
},
{
"buffer": 3,
"file": "chapter6.md",
"semi_transient": false,
"settings":
{
"buffer_size": 7680,
"regions":
{
},
"selection":
[
[
251,
251
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 9,
"type": "text"
},
{
"buffer": 4,
"file": "chapter5.md",
"semi_transient": false,
"settings":
{
"buffer_size": 27307,
"regions":
{
},
"selection":
[
[
165,
165
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 8,
"type": "text"
},
{
"buffer": 5,
"file": "chapter4.md",
"semi_transient": false,
"settings":
{
"buffer_size": 9866,
"regions":
{
},
"selection":
[
[
186,
186
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 2092.0,
"zoom_level": 1.0
},
"stack_index": 4,
"type": "text"
},
{
"buffer": 6,
"file": "chapter3.md",
"semi_transient": false,
"settings":
{
"buffer_size": 11549,
"regions":
{
},
"selection":
[
[
790,
631
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 6,
"type": "text"
},
{
"buffer": 7,
"file": "course.yml",
"semi_transient": false,
"settings":
{
"buffer_size": 708,
"regions":
{
},
"selection":
[
[
354,
354
]
],
"settings":
{
"syntax": "Packages/YAML/YAML.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 3,
"type": "text"
},
{
"buffer": 8,
"file": "chapter1.md",
"semi_transient": false,
"settings":
{
"buffer_size": 6780,
"regions":
{
},
"selection":
[
[
6780,
6780
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 3532.0,
"zoom_level": 1.0
},
"stack_index": 2,
"type": "text"
},
{
"buffer": 9,
"file": "README.md",
"semi_transient": false,
"settings":
{
"buffer_size": 1933,
"regions":
{
},
"selection":
[
[
831,
831
]
],
"settings":
{
"syntax": "Packages/Markdown/Markdown.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 5,
"type": "text"
},
{
"buffer": 10,
"semi_transient": false,
"settings":
{
"buffer_size": 117,
"regions":
{
},
"selection":
[
[
117,
117
]
],
"settings":
{
"auto_name": "List of possible questions:",
"default_dir": "C:\\Users\\lenovo\\python_intro_hackathon",
"syntax": "Packages/Text/Plain text.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 7,
"type": "text"
}
]
}
],
"incremental_find":
{
"height": 23.0
},
"input":
{
"height": 31.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
1
]
],
"cols":
[
0.0,
1.0
],
"rows":
[
0.0,
1.0
]
},
"menu_visible": true,
"output.find_results":
{
"height": 0.0
},
"pinned_build_system": "",
"project": "Python_intro_hackathon.sublime-project",
"replace":
{
"height": 42.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"select_project":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"select_symbol":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"selected_group": 0,
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 275.0,
"status_bar_visible": true,
"template_settings":
{
}
}