├── Algorithms_Methodology.ipynb
├── Arrays 101.ipynb
├── Cryptocurrency - EDA and Visualization Fresco.ipynb
├── Data Visualisation with Matplotlib.ipynb
├── Database API.ipynb
├── Dynamic Programming.ipynb
├── EDA on Sleep.ipynb
├── EDA on Weather.ipynb
├── Facebook - EDA Fresco.ipynb
├── File Operation.ipynb
├── Flask API.ipynb
├── Jupyter Notebook formatting.ipynb
├── Linked List.ipynb
├── NumPy.ipynb
├── Pandas - I.ipynb
├── Pandas - II.ipynb
├── Queue & Stack.ipynb
├── README.md
├── Rough Work.ipynb
├── Stats with Python.ipynb
├── String and Arrays.ipynb
├── Tips and Tricks for Python.ipynb
├── Wings Core Tech_T3_Machine First And Intelligent Business Processes.md
├── background
├── Reorder Linked List Sol.jpeg
├── deque.png
├── generator.gif
├── iterators-and-generators-in-python-4-1657095549.png
├── jupyter_format.gif
├── kurtosis.webp
├── list_deque.jpg
├── markdown.gif
├── matplotlib_anatomy.gif
├── permu_comb.png
└── stack_que.png
├── datasets
├── Crypto Data.csv
├── Data - Multiple Worksheets.xlsx
├── Data - Single Worksheet.xlsx
├── Restaurant - Customers.csv
├── Restaurant - Foods.csv
├── Restaurant - Week 1 Sales.csv
├── Restaurant - Week 1 Satisfaction.csv
├── Restaurant - Week 2 Sales.csv
├── SleepStudyData.csv
├── bigmac.csv
├── chicago.csv
├── crops.csv
├── data_weather.csv
├── ecommerce.csv
├── employees.csv
├── facebook.csv
├── foods.csv
├── fortune1000.csv
├── google_stock_price.csv
├── jamesbond.csv
├── nba.csv
├── pokemon.csv
├── quarters.csv
├── revenue.csv
├── salesmen.csv
└── worldstats.csv
├── file.txt
├── foo.py
├── mydb.db
└── myplot.png
/Algorithms_Methodology.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Algorithms or Methodology "
8 | ]
9 | },
10 | {
11 | "cell_type": "markdown",
12 | "metadata": {},
13 | "source": [
14 | "***\n",
15 | "## Binary Search \n",
16 | "***\n",
17 | "\n",
18 | "+ Don't write mid = (low + high) / 2, as this can lead to overflow.\n",
19 | " + Write mid = low + (high - low) / 2, this will give desired results.\n",
20 | " + When we add two signed 32-bit integers, we always run the risk of overflow. We can try it yourself with low = 1 and high = Integer.MAX_VALUE. We'll notice however that the second way stops this overflow from occurring, and you get your expected result.\n",
21 | "+ Examples for it's usage: link "
22 | ]
23 | },
24 | {
25 | "cell_type": "markdown",
26 | "metadata": {},
27 | "source": [
28 | "***\n",
29 | "## Rotate Array \n",
30 | "***\n",
31 | "\n",
32 | "Input: nums = [1,2,3,4,5,6,7], k = 3
\n",
33 | "Output: [5,6,7,1,2,3,4]
\n",
34 | "+ In-place solution:\n",
35 | "``` N = len(nums)\n",
36 | " k = k % N //to prevent out-of bound exception\n",
37 | " reverse(nums, 0, N-k-1) //Reverse first N-k half\n",
38 | " reverse(nums, N-k, N-1) //Reverse last k half\n",
39 | " reverse(nums, 0, N-1) //Reverse the full\n",
40 | "```"
41 | ]
42 | },
43 | {
44 | "cell_type": "markdown",
45 | "metadata": {},
46 | "source": [
47 | "***\n",
48 | "## Move Zeroes \n",
49 | "***\n",
50 | "\n",
51 | "Move Zeroes to the right, maintaing the relative order of elements
\n",
52 | "Input: nums = [0,1,0,3,12]
\n",
53 | "Output: [1,3,12,0,0]
\n",
54 | "+ In-place solution:\n",
55 | " pos = 0\n",
56 | " for i in range(len(nums)): //move all non-zero elements to the left\n",
57 | " if nums[i] != 0:\n",
58 | " nums[pos] = nums[i]\n",
59 | " pos += 1\n",
60 | " for i in range(pos, len(nums)): //fill the rest position with 0\n",
61 | " nums[i] = 0 \n",
62 | "+ Eg.\n",
63 | " [0,1,0,3,12] //initial state\n",
64 | " [0,1,0,3,12] //itr 0, as nums[i] == 0: do nothing\n",
65 | " [1,1,0,3,12] //itr 1\n",
66 | " [1,1,0,3,12] //itr 2, as nums[i] == 0: do nothing\n",
67 | " [1,3,0,3,12] //itr 3\n",
68 | " [1,3,12,3,12] //itr 4\n",
69 | " [1,3,12,0,0] // now, fill rest with zero"
70 | ]
71 | },
72 | {
73 | "cell_type": "markdown",
74 | "metadata": {},
75 | "source": [
76 | "***\n",
77 | "## Two pointer applications \n",
78 | "***\n",
79 | "\n",
80 | "+ Slow & fast pointer approach\n",
81 | " * Also known as Floyd's slow & fast pointer approach.\n",
82 | " * Algorithm:\n",
83 | " * Each time, slow ptr go 1 steps while fast ptr go 2 steps.\n",
84 | " * When fast ptr arrives at the end, slow ptr will arrive right in the middle (used to find mid-point in linked list)\n",
85 | " * Can be used to :\n",
86 | " 1. To detect cycle in linked list, as both pointer pointers meet at some state.\n",
87 | " 2. To find the mid-point of linked list\n",
88 | "
\n",
89 | "+ Remove Nth node from the End of the list\n",
90 | " * A one pass solution can be done using pointers. \n",
91 | "```\n",
92 | " public ListNode removeNthFromEnd(ListNode head, int n) {\n",
93 | " ListNode fast, slow;\n",
94 | " fast = slow = head;\n",
95 | "\n",
96 | " for(int i = 1; i <= n; i++) //move fast pointer n+1 node forward\n",
97 | " fast = fast.next;\n",
98 | "\n",
99 | " if(fast == null) //if n == size of list, remove first node\n",
100 | " return head.next;\n",
101 | "\n",
102 | " while(fast.next != null) {\n",
103 | " slow = slow.next;\n",
104 | " fast = fast.next;\n",
105 | " }\n",
106 | " slow.next = slow.next.next;\n",
107 | " return head;\n",
108 | " }\n",
109 | "```\n",
110 | "
"
111 | ]
112 | },
113 | {
114 | "cell_type": "markdown",
115 | "metadata": {},
116 | "source": [
117 | "***\n",
118 | "## Graph concepts \n",
119 | "***"
120 | ]
121 | },
122 | {
123 | "cell_type": "markdown",
124 | "metadata": {},
125 | "source": [
126 | "### Depth First Search (DFS)\n",
127 | "\n",
128 | "* A connected acyclic graph is called a tree, means tree is a subset of graph.\n",
129 | "* Depth-first search is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. So the basic idea is to start from the root or any arbitrary node and mark the node and move to the adjacent unmarked node and continue this loop until there is no unmarked adjacent node. Then backtrack and check for other unmarked nodes and traverse them. Finally, print the nodes in the path.\n",
130 | "* Depth-first search is used in:\n",
131 | " * Topological sorting\n",
132 | " * scheduling problems \n",
133 | " * cycle detection in graphs\n",
134 | " * solving puzzles with only one solution, such as a maze or a sudoku puzzle.\n",
135 | "
"
136 | ]
137 | },
138 | {
139 | "cell_type": "markdown",
140 | "metadata": {},
141 | "source": [
142 | "### Topological sorting . \n",
143 | "\n",
144 | "* Topological sort or topological ordering of a *directed graph* is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering.\n",
145 | "* The Applications of Topological Sort are -\n",
146 | " * Course Schedule problem.\n",
147 | " * Finding cycle in a graph.\n",
148 | " * Operation System deadlock detection.\n",
149 | " * Dependency resolution.\n",
150 | " * Sentence Ordering.\n",
151 | " * Critical Path Analysis.\n",
152 | " * Other applications like manufacturing workflows, data serialization and context-free grammar.\n",
153 | "* Algorithms used in Topological Sorting are -\n",
154 | " 1. Kahn's algorithm \n",
155 | " 2. DFS "
156 | ]
157 | }
158 | ],
159 | "metadata": {
160 | "kernelspec": {
161 | "display_name": "Python 3 (ipykernel)",
162 | "language": "python",
163 | "name": "python3"
164 | },
165 | "language_info": {
166 | "codemirror_mode": {
167 | "name": "ipython",
168 | "version": 3
169 | },
170 | "file_extension": ".py",
171 | "mimetype": "text/x-python",
172 | "name": "python",
173 | "nbconvert_exporter": "python",
174 | "pygments_lexer": "ipython3",
175 | "version": "3.10.5"
176 | }
177 | },
178 | "nbformat": 4,
179 | "nbformat_minor": 4
180 | }
181 |
--------------------------------------------------------------------------------
/Arrays 101.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Arrays 101 "
8 | ]
9 | },
10 | {
11 | "cell_type": "markdown",
12 | "metadata": {},
13 | "source": [
14 | "## Find Numbers with Even Number of Digits\n",
15 | "Given an array nums of integers, return how many of them contain an even number of digits.\n",
16 | " \n",
17 | "*Example 1:*
\n",
18 | "Input: nums = [12,345,2,6,7896]
\n",
19 | "Output: 2
\n",
20 | "Explanation:
\n",
21 | " 12 contains 2 digits (even number of digits).
\n",
22 | " 345 contains 3 digits (odd number of digits).
\n",
23 | " 2 contains 1 digit (odd number of digits).
\n",
24 | " 6 contains 1 digit (odd number of digits).
\n",
25 | " 7896 contains 4 digits (even number of digits).
\n",
26 | " Therefore only 12 and 7896 contain an even number of digits.\n",
27 | "\n",
28 | "*Example 2:*
\n",
29 | "Input: nums = [555,901,482,1771]
\n",
30 | "Output: 1
\n",
31 | "Explanation:
\n",
32 | "Only 1771 contains an even number of digits.\n",
33 | " \n",
34 | "*Constraints:*\n",
35 | "* 1 <= nums.length <= 500\n",
36 | "* 1 <= nums[i] <= $10^5$"
37 | ]
38 | },
39 | {
40 | "cell_type": "code",
41 | "execution_count": 5,
42 | "metadata": {},
43 | "outputs": [
44 | {
45 | "name": "stdout",
46 | "output_type": "stream",
47 | "text": [
48 | "2\n"
49 | ]
50 | }
51 | ],
52 | "source": [
53 | "class Solution(object):\n",
54 | " def findNumbers(self, nums):\n",
55 | " \"\"\"\n",
56 | " :type nums: List[int]\n",
57 | " :rtype: int\n",
58 | " \"\"\"\n",
59 | " #focusing on list comprehension to solve otherwise res_nums list not necessarily required that much\n",
60 | " \n",
61 | " #convert every num to str type\n",
62 | " str_nums = [str(num) for num in nums]\n",
63 | " \n",
64 | " #if str_num len is divisible by 2 then add 1 to res_num list and finally sum of the list\n",
65 | " res_nums = [1 for sn in str_nums if len(sn)%2 == 0]\n",
66 | "\n",
67 | " return sum(res_nums)\n",
68 | "\n",
69 | "\n",
70 | "# main\n",
71 | "obj = Solution()\n",
72 | "lst = [12,345,2,6,7896]\n",
73 | "print(obj.findNumbers(lst))"
74 | ]
75 | },
76 | {
77 | "cell_type": "markdown",
78 | "metadata": {},
79 | "source": [
80 | "## Squares of a Sorted Array\n",
81 | "Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.\n",
82 | "\n",
83 | "*Example 1:*
\n",
84 | "Input: nums = [-4,-1,0,3,10]
\n",
85 | "Output: [0,1,9,16,100]
\n",
86 | "Explanation: After squaring, the array becomes [16,1,0,9,100].
\n",
87 | "After sorting, it becomes [0,1,9,16,100].
\n",
88 | "\n",
89 | "*Example 2:*
\n",
90 | "Input: nums = [-7,-3,2,3,11]
\n",
91 | "Output: [4,9,9,49,121]
\n",
92 | " \n",
93 | "*Constraints:*\n",
94 | "* $1 <= nums.length <= 10^4$\n",
95 | "* $-10^4 <= nums[i] <= 10^4$\n",
96 | "* nums is sorted in non-decreasing order.\n",
97 | " \n",
98 | "\n",
99 | "Follow up: Squaring each element and sorting the new array is very trivial, could you find an O(n) solution using a different approach?"
100 | ]
101 | },
102 | {
103 | "cell_type": "code",
104 | "execution_count": 12,
105 | "metadata": {},
106 | "outputs": [
107 | {
108 | "name": "stdout",
109 | "output_type": "stream",
110 | "text": [
111 | "[0, 1, 9, 16, 100]\n"
112 | ]
113 | }
114 | ],
115 | "source": [
116 | "class Solution(object):\n",
117 | " def sortedSquares(self, nums):\n",
118 | " \"\"\"\n",
119 | " :type nums: List[int]\n",
120 | " :rtype: List[int]\n",
121 | " \"\"\"\n",
122 | " # using two-pointer technique, we can solve it in O(n) time complexity\n",
123 | " \n",
124 | " i = 0\n",
125 | " len_ = len(nums)\n",
126 | " j = len_ - 1\n",
127 | " count = 0\n",
128 | " res = []\n",
129 | " \n",
130 | " # move the pointer i and j, fwd or bwd respectively according to larger of them (ignoring -ve sign) \n",
131 | " while count != len_:\n",
132 | " if abs(nums[i]) > abs(nums[j]):\n",
133 | " res.insert(0, nums[i]*nums[i])\n",
134 | " i += 1\n",
135 | " count += 1\n",
136 | " else:\n",
137 | " res.insert(0, nums[j]*nums[j])\n",
138 | " j -= 1\n",
139 | " count += 1\n",
140 | " \n",
141 | " return res\n",
142 | " \n",
143 | "\n",
144 | "\n",
145 | "# main\n",
146 | "lst = [-4,-1,0,3,10]\n",
147 | "# lst = [-7,-3,2,3,11]\n",
148 | "# lst = [0, 0]\n",
149 | "print(Solution.sortedSquares(Solution, lst))"
150 | ]
151 | },
152 | {
153 | "cell_type": "markdown",
154 | "metadata": {},
155 | "source": [
156 | "## Duplicate Zeros\n",
157 | "Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right.\n",
158 | "\n",
159 | "Note that elements beyond the length of the original array are not written. Do the above modifications to the input array **in-place** and do not return anything.\n",
160 | "\n",
161 | "*Example 1:*
\n",
162 | "Input: arr = [1,0,2,3,0,4,5,0]
\n",
163 | "Output: [1,0,0,2,3,0,0,4]
\n",
164 | "Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4]
\n",
165 | "\n",
166 | "*Example 2:*\n",
167 | "Input: arr = [1,2,3]
\n",
168 | "Output: [1,2,3]
\n",
169 | "Explanation: After calling your function, the input array is modified to: [1,2,3]
\n",
170 | " \n",
171 | "*Constraints:*\n",
172 | "* 1 <= arr.length <= $10^4$\n",
173 | "* 0 <= arr[i] <= 9"
174 | ]
175 | },
176 | {
177 | "cell_type": "code",
178 | "execution_count": 27,
179 | "metadata": {},
180 | "outputs": [
181 | {
182 | "name": "stdout",
183 | "output_type": "stream",
184 | "text": [
185 | "[1, 0, 0, 2, 3, 0, 0, 4]\n"
186 | ]
187 | }
188 | ],
189 | "source": [
190 | "class Solution(object):\n",
191 | " def duplicateZeros(self, arr):\n",
192 | " \"\"\"\n",
193 | " :type arr: List[int]\n",
194 | " :rtype: None Do not return anything, modify arr in-place instead.\n",
195 | " \"\"\"\n",
196 | " # corner case ie. if arr[i]=0; 0 <= i < n and all arr[i] are +ve int\n",
197 | " if not sum(arr):\n",
198 | " return\n",
199 | " \n",
200 | " i = 0\n",
201 | " while i < len(arr):\n",
202 | " if not arr[i]:\n",
203 | " arr.pop() # deletes element from last and insert 0 at i-th pos\n",
204 | " arr.insert(i, 0)\n",
205 | " i += 1\n",
206 | " i += 1\n",
207 | " \n",
208 | " return \n",
209 | "\n",
210 | " \n",
211 | "# main\n",
212 | "lst = [1,0,2,3,0,4,5,0]\n",
213 | "# lst = [1,2,3]\n",
214 | "Solution.duplicateZeros(Solution, lst)\n",
215 | "print(lst)"
216 | ]
217 | },
218 | {
219 | "cell_type": "markdown",
220 | "metadata": {},
221 | "source": [
222 | "## Merge Sorted Array\n",
223 | "\n",
224 | "You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.\n",
225 | "\n",
226 | "Merge nums1 and nums2 into a single array sorted in non-decreasing order.\n",
227 | "\n",
228 | "The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.\n",
229 | "\n",
230 | " \n",
231 | "*Example 1:*
\n",
232 | "Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
\n",
233 | "Output: [1,2,2,3,5,6]
\n",
234 | "Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
\n",
235 | "The result of the merge is [1,2,2,3,5,6] with the underlined elements coming from nums1.\n",
236 | "\n",
237 | "*Example 2:*
\n",
238 | "Input: nums1 = [1], m = 1, nums2 = [], n = 0
\n",
239 | "Output: [1]
\n",
240 | "Explanation: The arrays we are merging are [1] and [].
\n",
241 | "The result of the merge is [1].
\n",
242 | "\n",
243 | "*Example 3:*
\n",
244 | "Input: nums1 = [0], m = 0, nums2 = [1], n = 1
\n",
245 | "Output: [1]
\n",
246 | "Explanation: The arrays we are merging are [] and [1].
\n",
247 | "The result of the merge is [1].
\n",
248 | "Note that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1.\n",
249 | " \n",
250 | "\n",
251 | "*Constraints:*\n",
252 | "* nums1.length == m + n\n",
253 | "* nums2.length == n\n",
254 | "* 0 <= m, n <= 200\n",
255 | "* 1 <= m + n <= 200\n",
256 | "* $-10^9 <= nums1[i], nums2[j] <= 10^9$\n",
257 | " \n",
258 | "Follow up: Can you come up with an algorithm that runs in O(m + n) time?\n",
259 | "\n",
260 | "**This quite takes me time, and main step is i < len(nums1) in first while loop condition of function**"
261 | ]
262 | },
263 | {
264 | "cell_type": "code",
265 | "execution_count": 67,
266 | "metadata": {},
267 | "outputs": [
268 | {
269 | "name": "stdout",
270 | "output_type": "stream",
271 | "text": [
272 | "Times = 2\n",
273 | "-------------------------------------------------------------------------------------------------------------- \n",
274 | " --------------------------------------------------------------------------------------------------------------\n",
275 | "Iter = 0\n",
276 | "--------------------------------------------------------------------------------------------------------------\n",
277 | "Iter = 1\n",
278 | "--------------------------------------------------------------------------------------------------------------\n",
279 | "All good\n"
280 | ]
281 | }
282 | ],
283 | "source": [
284 | "from random import randint\n",
285 | "\n",
286 | "class Solution(object):\n",
287 | " def merge(self, nums1, m, nums2, n):\n",
288 | " \"\"\"\n",
289 | " :type nums1: List[int]\n",
290 | " :type m: int\n",
291 | " :type nums2: List[int]\n",
292 | " :type n: int\n",
293 | " :rtype: None Do not return anything, modify nums1 in-place instead.\n",
294 | " \"\"\"\n",
295 | " # using two-pointer technique\n",
296 | " \n",
297 | " # i and j are pointers for num1 and num2 respectively\n",
298 | " i = 0\n",
299 | " j = 0\n",
300 | " \n",
301 | " nums1[m:] = [] # to shrink the list\n",
302 | " \n",
303 | " while i < len(nums1) and j < n: \n",
304 | " if nums1[i] >= nums2[j]:\n",
305 | " nums1.insert(i, nums2[j])\n",
306 | " j += 1 \n",
307 | " i += 1\n",
308 | " \n",
309 | " if j != n:\n",
310 | " while j < n:\n",
311 | " i += 1\n",
312 | " nums1.insert(i, nums2[j])\n",
313 | " j += 1\n",
314 | "\n",
315 | " return\n",
316 | "\n",
317 | "\n",
318 | " \n",
319 | "\n",
320 | "# algo-checker\n",
321 | "if __name__ == '__main__':\n",
322 | " times = randint(1, 10)\n",
323 | " _ = \"-\"*110\n",
324 | " print(\"Times =\", times)\n",
325 | " print(_, '\\n' ,_)\n",
326 | "\n",
327 | " for t in range(0, times):\n",
328 | " print(\"Iter =\", t)\n",
329 | " print(_)\n",
330 | " m = randint(0, 200)\n",
331 | " n = randint(0, 200)\n",
332 | " nums1 = []\n",
333 | " nums2 = []\n",
334 | "\n",
335 | " for i in range(m):\n",
336 | " nums1.append(randint(-10e9, 10e9))\n",
337 | " nums1.sort()\n",
338 | " tmp_nums1 = nums1[:]\n",
339 | "\n",
340 | " for i in range(n):\n",
341 | " nums2.append(randint(-10e9, 10e9))\n",
342 | " nums1.append(0)\n",
343 | " nums2.sort()\n",
344 | "\n",
345 | " merger_chk = tmp_nums1 + nums2\n",
346 | " merger_chk.sort()\n",
347 | " Solution.merge(Solution, nums1, m, nums2, n)\n",
348 | "\n",
349 | " if merger_chk != nums1:\n",
350 | " print(\"nums1 =\", tmp_nums1, \"\\nnums2 =\", nums2)\n",
351 | " print(\"Result =\", nums1)\n",
352 | " _ = '*' * 108\n",
353 | " print(_)\n",
354 | " break\n",
355 | " else:\n",
356 | " print(\"All good\")"
357 | ]
358 | },
359 | {
360 | "cell_type": "markdown",
361 | "metadata": {},
362 | "source": [
363 | "## Check If N and Its Double Exist\n",
364 | "Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M).\n",
365 | "\n",
366 | "More formally check if there exists two indices i and j such that :\n",
367 | "* i != j\n",
368 | "* 0 <= i, j < arr.length\n",
369 | "* arr[i] == 2 * arr[j]\n",
370 | " \n",
371 | "\n",
372 | "*Example 1:*
\n",
373 | "Input: arr = [10,2,5,3]
\n",
374 | "Output: true
\n",
375 | "Explanation: N = 10 is the double of M = 5,that is, 10 = 2 * 5.\n",
376 | "\n",
377 | "*Example 2:*
\n",
378 | "Input: arr = [7,1,14,11]
\n",
379 | "Output: true
\n",
380 | "Explanation: N = 14 is the double of M = 7,that is, 14 = 2 * 7.\n",
381 | "\n",
382 | "*Example 3:*
\n",
383 | "Input: arr = [3,1,7,11]
\n",
384 | "Output: false
\n",
385 | "Explanation: In this case does not exist N and M, such that N = 2 * M.\n",
386 | " \n",
387 | "*Constraints:*\n",
388 | "* $2 <= arr.length <= 500$\n",
389 | "* $-10^3 <= arr[i] <= 10^3$"
390 | ]
391 | },
392 | {
393 | "cell_type": "code",
394 | "execution_count": 91,
395 | "metadata": {},
396 | "outputs": [
397 | {
398 | "name": "stdout",
399 | "output_type": "stream",
400 | "text": [
401 | "True\n"
402 | ]
403 | }
404 | ],
405 | "source": [
406 | "class Solution(object):\n",
407 | " def checkIfExist(self, arr):\n",
408 | " \"\"\"\n",
409 | " :type arr: List[int]\n",
410 | " :rtype: bool\n",
411 | " \"\"\"\n",
412 | " for i in range(len(arr)):\n",
413 | " # to eliminate same indx coincide main case is arr = [0]\n",
414 | " if arr[i]*2 in arr[i+1:] or arr[i]*2 in arr[:i]: \n",
415 | " return True\n",
416 | " return False\n",
417 | "\n",
418 | " \n",
419 | "\n",
420 | "if __name__ == '__main__':\n",
421 | " lst = [10,2,5,3]\n",
422 | " print(Solution.checkIfExist(Solution, lst))"
423 | ]
424 | },
425 | {
426 | "cell_type": "markdown",
427 | "metadata": {},
428 | "source": [
429 | "## Valid Mountain Array\n",
430 | "\n",
431 | "Given an array of integers arr, return true if and only if it is a valid mountain array.\n",
432 | "\n",
433 | "Recall that arr is a mountain array if and only if:\n",
434 | "* arr.length >= 3\n",
435 | "* There exists some i with 0 < i < arr.length - 1 such that:\n",
436 | " * arr[0] < arr[1] < ... < arr[i - 1] < arr[i]\n",
437 | " * arr[i] > arr[i + 1] > ... > arr[arr.length - 1]\n",
438 | "\n",
439 | "
\n",
440 | "\n",
441 | "*Example 1:*
\n",
442 | "Input: arr = [2,1]
\n",
443 | "Output: false \n",
444 | "\n",
445 | "*Example 2:*
\n",
446 | "Input: arr = [3,5,5]
\n",
447 | "Output: false \n",
448 | "\n",
449 | "*Example 3:*
\n",
450 | "Input: arr = [0,3,2,1]
\n",
451 | "Output: true\n",
452 | " \n",
453 | "*Constraints:*\n",
454 | "* $1 <= arr.length <= 10^4$\n",
455 | "* $0 <= arr[i] <= 10^4$"
456 | ]
457 | },
458 | {
459 | "cell_type": "code",
460 | "execution_count": 36,
461 | "metadata": {},
462 | "outputs": [
463 | {
464 | "name": "stdout",
465 | "output_type": "stream",
466 | "text": [
467 | "[7, 8, 10, 3]\n",
468 | "[7, 10, 7, 0]\n",
469 | "[7, 9, 10, 4, 3]\n",
470 | "[2, 9, 3]\n",
471 | "[0, 10, 8]\n"
472 | ]
473 | }
474 | ],
475 | "source": [
476 | "from random import randint\n",
477 | "\n",
478 | "class Solution(object):\n",
479 | " def validMountainArray(self, arr):\n",
480 | " \"\"\"\n",
481 | " :type arr: List[int]\n",
482 | " :rtype: bool\n",
483 | " \"\"\"\n",
484 | " # corner case\n",
485 | " len_ = len(arr)\n",
486 | " if len_ < 3:\n",
487 | " return False\n",
488 | " \n",
489 | " # first check for increasing order\n",
490 | " i = 0\n",
491 | " while i < len_-1:\n",
492 | " if arr[i] < arr[i+1]:\n",
493 | " i += 1\n",
494 | " else:\n",
495 | " break\n",
496 | " \n",
497 | " # this i-th index is the peak of mountain if all-goes well\n",
498 | " if i >= len_-1 or i == 0:\n",
499 | " return False\n",
500 | " \n",
501 | " # at-last check for decreasing order \n",
502 | " while i < len_-1:\n",
503 | " if arr[i] > arr[i+1]:\n",
504 | " i += 1\n",
505 | " else:\n",
506 | " return False\n",
507 | " \n",
508 | " return True\n",
509 | "\n",
510 | "\n",
511 | "# main\n",
512 | "if __name__ == '__main__':\n",
513 | " # random test-case generator\n",
514 | " times = randint(1, 100)\n",
515 | " \n",
516 | " for t in range(times):\n",
517 | " n = randint(1, 10)\n",
518 | " lst = [randint(0, 10) for i in range(n)]\n",
519 | " if Solution.validMountainArray(Solution, lst):\n",
520 | " print(lst)\n",
521 | " "
522 | ]
523 | },
524 | {
525 | "cell_type": "markdown",
526 | "metadata": {},
527 | "source": [
528 | "## Replace Elements with Greatest Element on Right Side\n",
529 | "Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.\n",
530 | "\n",
531 | "After doing so, return the array.\n",
532 | "\n",
533 | "*Example 1:*
\n",
534 | "Input: arr = [17,18,5,4,6,1]
\n",
535 | "Output: [18,6,6,6,1,-1]
\n",
536 | "Explanation:\n",
537 | "- index 0 --> the greatest element to the right of index 0 is index 1 (18).\n",
538 | "- index 1 --> the greatest element to the right of index 1 is index 4 (6).\n",
539 | "- index 2 --> the greatest element to the right of index 2 is index 4 (6).\n",
540 | "- index 3 --> the greatest element to the right of index 3 is index 4 (6).\n",
541 | "- index 4 --> the greatest element to the right of index 4 is index 5 (1).\n",
542 | "- index 5 --> there are no elements to the right of index 5, so we put -1.\n",
543 | "\n",
544 | "*Example 2:*
\n",
545 | "Input: arr = [400]
\n",
546 | "Output: [-1]
\n",
547 | "Explanation: There are no elements to the right of index 0.\n",
548 | " \n",
549 | "*Constraints:*\n",
550 | "* $1 <= arr.length <= 10^4$\n",
551 | "* $1 <= arr[i] <= 10^5$"
552 | ]
553 | },
554 | {
555 | "cell_type": "code",
556 | "execution_count": 49,
557 | "metadata": {},
558 | "outputs": [
559 | {
560 | "name": "stdout",
561 | "output_type": "stream",
562 | "text": [
563 | "----------------------------------------------------------------------------------------------------\n",
564 | "[4, 4]\n",
565 | "[4, -1]\n"
566 | ]
567 | }
568 | ],
569 | "source": [
570 | "from random import randint\n",
571 | "\n",
572 | "class Solution(object):\n",
573 | " def replaceElements(self, arr):\n",
574 | " \"\"\"\n",
575 | " :type arr: List[int]\n",
576 | " :rtype: List[int]\n",
577 | " \"\"\"\n",
578 | " len_ = len(arr)\n",
579 | " i = 0\n",
580 | " \n",
581 | " while i < len_-1:\n",
582 | " mx = max(arr[i+1:])\n",
583 | " arr[i] = mx\n",
584 | " i += 1\n",
585 | " \n",
586 | " # at the last index \n",
587 | " arr[i] = -1\n",
588 | " \n",
589 | " return arr\n",
590 | " \n",
591 | "\n",
592 | "\n",
593 | "# main\n",
594 | "if __name__ == '__main__':\n",
595 | " times = randint(1, 5)\n",
596 | " \n",
597 | " for t in range(times):\n",
598 | " lst = [randint(1, 10) for ele in range(randint(1, 5))]\n",
599 | " print('-'*100)\n",
600 | " print(lst)\n",
601 | " print(Solution.replaceElements(Solution, lst))"
602 | ]
603 | },
604 | {
605 | "cell_type": "markdown",
606 | "metadata": {},
607 | "source": [
608 | "## Sort Array By Parity\n",
609 | "Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers.\n",
610 | "Return any array that satisfies this condition.\n",
611 | "\n",
612 | " \n",
613 | "*Example 1:*
\n",
614 | "Input: nums = [3,1,2,4]
\n",
615 | "Output: [2,4,3,1]
\n",
616 | "Explanation: The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.\n",
617 | "\n",
618 | "*Example 2:*
\n",
619 | "Input: nums = [0]
\n",
620 | "Output: [0]
\n",
621 | " \n",
622 | "*Constraints:*\n",
623 | "* 1 <= nums.length <= 5000\n",
624 | "* 0 <= nums[i] <= 5000"
625 | ]
626 | },
627 | {
628 | "cell_type": "code",
629 | "execution_count": 4,
630 | "metadata": {},
631 | "outputs": [
632 | {
633 | "name": "stdout",
634 | "output_type": "stream",
635 | "text": [
636 | "[2, 6, 3, 1]\n"
637 | ]
638 | }
639 | ],
640 | "source": [
641 | "class Solution(object):\n",
642 | " def sortArrayByParity(self, nums):\n",
643 | " \"\"\"\n",
644 | " :type nums: List[int]\n",
645 | " :rtype: List[int]\n",
646 | " \"\"\"\n",
647 | " # using two-pointer technique\n",
648 | " l, h = 0, len(nums) - 1\n",
649 | " \n",
650 | " while l < h:\n",
651 | " # swap elements if num[l] is odd number and decrement high\n",
652 | " if nums[l] % 2:\n",
653 | " nums[l], nums[h] = nums[h], nums[l]\n",
654 | " h -= 1\n",
655 | " else:\n",
656 | " l += 1\n",
657 | " \n",
658 | " return nums\n",
659 | "\n",
660 | "\n",
661 | "if __name__ == '__main__':\n",
662 | " lst = [2,1,6,3]\n",
663 | " obj = Solution()\n",
664 | " print(obj.sortArrayByParity(lst))"
665 | ]
666 | },
667 | {
668 | "cell_type": "markdown",
669 | "metadata": {},
670 | "source": [
671 | "## Height Checker\n",
672 | "A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer array expected where expected[i] is the expected height of the ith student in line.\n",
673 | "\n",
674 | "You are given an integer array heights representing the current order that the students are standing in. Each heights[i] is the height of the ith student in line (0-indexed).\n",
675 | "\n",
676 | "Return the number of indices where heights[i] != expected[i].\n",
677 | "\n",
678 | " \n",
679 | "\n",
680 | "*Example 1:*
\n",
681 | "Input: heights = [1,1,4,2,1,3]
\n",
682 | "Output: 3
\n",
683 | "Explanation:
\n",
684 | "heights: [1,1,4,2,1,3]
\n",
685 | "expected: [1,1,1,2,3,4]
\n",
686 | "Indices 2, 4, and 5 do not match.
\n",
687 | "\n",
688 | "\n",
689 | "*Example 2:*\n",
690 | "Input: heights = [5,1,2,3,4]
\n",
691 | "Output: 5
\n",
692 | "Explanation:
\n",
693 | "heights: [5,1,2,3,4]
\n",
694 | "expected: [1,2,3,4,5]
\n",
695 | "All indices do not match.
\n",
696 | "\n",
697 | "\n",
698 | "*Example 3:*
\n",
699 | "Input: heights = [1,2,3,4,5]
\n",
700 | "Output: 0
\n",
701 | "Explanation:
\n",
702 | "heights: [1,2,3,4,5]
\n",
703 | "expected: [1,2,3,4,5]
\n",
704 | "All indices match.
\n",
705 | " \n",
706 | "\n",
707 | "*Constraints:*\n",
708 | "* 1 <= heights.length <= 100\n",
709 | "* 1 <= heights[i] <= 100"
710 | ]
711 | },
712 | {
713 | "cell_type": "code",
714 | "execution_count": 5,
715 | "metadata": {},
716 | "outputs": [
717 | {
718 | "name": "stdout",
719 | "output_type": "stream",
720 | "text": [
721 | "[1, 1, 1, 2, 3, 4]\n",
722 | "3\n"
723 | ]
724 | }
725 | ],
726 | "source": [
727 | "class Solution(object):\n",
728 | " def heightChecker(self, heights):\n",
729 | " \"\"\"\n",
730 | " :type heights: List[int]\n",
731 | " :rtype: int\n",
732 | " \"\"\"\n",
733 | " # duplicate of original array without reference\n",
734 | " another = heights[:]\n",
735 | " another.sort()\n",
736 | "\n",
737 | " count = 0\n",
738 | " \n",
739 | " for i in range(len(heights)):\n",
740 | " if another[i] != heights[i]:\n",
741 | " count += 1\n",
742 | " \n",
743 | " return count\n",
744 | "\n",
745 | "\n",
746 | "if __name__ == '__main__':\n",
747 | " obj = Solution()\n",
748 | " lst = [1,1,4,2,1,3]\n",
749 | " print(obj.heightChecker(lst))"
750 | ]
751 | },
752 | {
753 | "cell_type": "markdown",
754 | "metadata": {},
755 | "source": [
756 | "## Third Maximum Number\n",
757 | "\n",
758 | "Given an integer array nums, return the third distinct maximum number in this array. **If the third maximum does not exist, return the maximum number.**\n",
759 | "\n",
760 | " \n",
761 | "\n",
762 | "*Example 1:*
\n",
763 | "Input: nums = [3,2,1]
\n",
764 | "Output: 1
\n",
765 | "Explanation:
\n",
766 | "The first distinct maximum is 3.
\n",
767 | "The second distinct maximum is 2.
\n",
768 | "The third distinct maximum is 1.
\n",
769 | "\n",
770 | "*Example 2:*
\n",
771 | "Input: nums = [1,2]
\n",
772 | "Output: 2
\n",
773 | "Explanation:
\n",
774 | "The first distinct maximum is 2.
\n",
775 | "The second distinct maximum is 1.
\n",
776 | "The third distinct maximum does not exist, so the maximum (2) is returned instead.\n",
777 | "\n",
778 | "*Example 3:*
\n",
779 | "Input: nums = [2,2,3,1]
\n",
780 | "Output: 1
\n",
781 | "Explanation:
\n",
782 | "The first distinct maximum is 3.
\n",
783 | "The second distinct maximum is 2 (both 2's are counted together since they have the same value).
\n",
784 | "The third distinct maximum is 1.
\n",
785 | " \n",
786 | "\n",
787 | "*Constraints:*\n",
788 | "* $1 <= nums.length <= 10^4$\n",
789 | "* $-2^{31} <= nums[i] <= 2^{31} - 1$\n",
790 | " \n",
791 | "\n",
792 | "Follow up: Can you find an O(n) solution?"
793 | ]
794 | },
795 | {
796 | "cell_type": "code",
797 | "execution_count": 38,
798 | "metadata": {},
799 | "outputs": [
800 | {
801 | "name": "stdout",
802 | "output_type": "stream",
803 | "text": [
804 | "[6, -3]\n",
805 | "6\n",
806 | "----------------------------------------------------------------------------------------------------\n",
807 | "[-6]\n",
808 | "-6\n",
809 | "----------------------------------------------------------------------------------------------------\n",
810 | "[-2, -8, -1, -1, -7]\n",
811 | "-7\n",
812 | "----------------------------------------------------------------------------------------------------\n",
813 | "[8, 2, 7, 9, -4]\n",
814 | "7\n",
815 | "----------------------------------------------------------------------------------------------------\n",
816 | "[2, -2]\n",
817 | "2\n",
818 | "----------------------------------------------------------------------------------------------------\n"
819 | ]
820 | }
821 | ],
822 | "source": [
823 | "from random import randint\n",
824 | "\n",
825 | "class Solution(object):\n",
826 | " def thirdMax(self, nums):\n",
827 | " \"\"\"\n",
828 | " :type nums: List[int]\n",
829 | " :rtype: int\n",
830 | " \"\"\"\n",
831 | " # Time complexity is O(n) and space-complexity is constant\n",
832 | " if not nums:\n",
833 | " return\n",
834 | " \n",
835 | " mx = max(nums)\n",
836 | " mx_lst = [mx]\n",
837 | " i = 1\n",
838 | " \n",
839 | " #try block for empty sequence error which can occured from max()\n",
840 | " try:\n",
841 | " while i < 3:\n",
842 | " #try block for element which is not present in sequence\n",
843 | " try:\n",
844 | " # remove all occurence of max element and if ValueError occurs update the max\n",
845 | " while True:\n",
846 | " nums.remove(mx)\n",
847 | " except ValueError:\n",
848 | " mx = max(nums)\n",
849 | " mx_lst.append(mx)\n",
850 | " i += 1\n",
851 | " except ValueError:\n",
852 | " if len(mx_lst) < 3:\n",
853 | " return max(mx_lst)\n",
854 | " \n",
855 | " return mx\n",
856 | "\n",
857 | "\n",
858 | " \n",
859 | "if __name__ == '__main__':\n",
860 | " # random test-case generator\n",
861 | " times = randint(1,10)\n",
862 | " for t in range(times):\n",
863 | " lst = [randint(-10,10) for ele in range(randint(1,5))]\n",
864 | " print(lst)\n",
865 | " \n",
866 | " obj = Solution()\n",
867 | " print(obj.thirdMax(lst))\n",
868 | " print('-'*100)\n",
869 | " "
870 | ]
871 | },
872 | {
873 | "cell_type": "markdown",
874 | "metadata": {},
875 | "source": [
876 | "## Find All Numbers Disappeared in an Array\n",
877 | "Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.\n",
878 | "\n",
879 | "*Example 1:*
\n",
880 | "Input: nums = [4,3,2,7,8,2,3,1]
\n",
881 | "Output: [5,6]\n",
882 | "\n",
883 | "*Example 2:*
\n",
884 | "Input: nums = [1,1]
\n",
885 | "Output: [2]\n",
886 | " \n",
887 | "\n",
888 | "*Constraints:*\n",
889 | "* n == nums.length\n",
890 | "* $1 <= n <= 10^5$\n",
891 | "* 1 <= nums[i] <= n\n",
892 | " \n",
893 | "\n",
894 | "Follow up: Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.\n",
895 | "\n",
896 | "**Solution**:
\n",
897 | "While accessing the element from the array, make the array[element] to negative (use the element as index and make that index value negative). Now after this operation, we were left out with some non-negative values, now just append those non-negative element's index position + 1 (ie. indx+1) to resultant array. Resulatant array would be the answer."
898 | ]
899 | },
900 | {
901 | "cell_type": "code",
902 | "execution_count": 24,
903 | "metadata": {},
904 | "outputs": [
905 | {
906 | "name": "stdout",
907 | "output_type": "stream",
908 | "text": [
909 | "[5, 6]\n"
910 | ]
911 | }
912 | ],
913 | "source": [
914 | "class Solution(object):\n",
915 | " def findDisappearedNumbers(self, nums):\n",
916 | " \"\"\"\n",
917 | " :type nums: List[int]\n",
918 | " :rtype: List[int]\n",
919 | " \"\"\"\n",
920 | " # By using negative index method, in O(n) time and O(1) space complexity respectively\n",
921 | " len_ = len(nums)\n",
922 | " res = []\n",
923 | " \n",
924 | " for ele in nums:\n",
925 | " # negate the indx pos\n",
926 | " indx = abs(ele) - 1\n",
927 | " if nums[indx] > 0:\n",
928 | " nums[indx] = -nums[indx]\n",
929 | " \n",
930 | " # append the indx + 1 to res for non-negative elements\n",
931 | " for i in range(len_):\n",
932 | " if nums[i] > 0:\n",
933 | " res.append(i + 1)\n",
934 | " \n",
935 | " return res\n",
936 | " \n",
937 | " \n",
938 | " def _findDisappearedNumbers(self, nums):\n",
939 | " \"\"\"\n",
940 | " :type nums: List[int]\n",
941 | " :rtype: List[int]\n",
942 | " \"\"\"\n",
943 | " # By use of hashing it takes O(n) time and space complexity\n",
944 | " len_ = len(nums)\n",
945 | " hash_ary = [0]*(len_+1)\n",
946 | " \n",
947 | " #incr the count of nums\n",
948 | " for ele in nums:\n",
949 | " hash_ary[ele] += 1\n",
950 | " \n",
951 | " return [indx for indx in range(1, len_+1) if not hash_ary[indx]]\n",
952 | "\n",
953 | "\n",
954 | " \n",
955 | "if __name__ == '__main__':\n",
956 | " obj = Solution()\n",
957 | " lst = [4,3,2,7,8,2,3,1]\n",
958 | " print(obj.findDisappearedNumbers(lst))"
959 | ]
960 | }
961 | ],
962 | "metadata": {
963 | "kernelspec": {
964 | "display_name": "Python 3 (ipykernel)",
965 | "language": "python",
966 | "name": "python3"
967 | },
968 | "language_info": {
969 | "codemirror_mode": {
970 | "name": "ipython",
971 | "version": 3
972 | },
973 | "file_extension": ".py",
974 | "mimetype": "text/x-python",
975 | "name": "python",
976 | "nbconvert_exporter": "python",
977 | "pygments_lexer": "ipython3",
978 | "version": "3.10.5"
979 | }
980 | },
981 | "nbformat": 4,
982 | "nbformat_minor": 4
983 | }
984 |
--------------------------------------------------------------------------------
/Dynamic Programming.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "## “Programming” in “Dynamic Programming” Has Nothing to Do with Programming! \n",
8 | "###### Richard Bellman developed this idea in 1950s working on an Air Force project."
9 | ]
10 | },
11 | {
12 | "cell_type": "markdown",
13 | "metadata": {},
14 | "source": [
15 | "## 1143. Longest Common Subsequence\n",
16 | "Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.\n",
17 | "\n",
18 | "A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.\n",
19 | "\n",
20 | "For example, \"ace\" is a subsequence of \"abcde\".\n",
21 | "A common subsequence of two strings is a subsequence that is common to both strings.\n",
22 | "\n",
23 | " \n",
24 | "\n",
25 | "*Example 1:*
\n",
26 | "Input: text1 = \"abcde\", text2 = \"ace\"
\n",
27 | "Output: 3
\n",
28 | "Explanation: The longest common subsequence is \"ace\" and its length is 3.\n",
29 | "\n",
30 | "*Example 2:*
\n",
31 | "Input: text1 = \"abc\", text2 = \"abc\"
\n",
32 | "Output: 3
\n",
33 | "Explanation: The longest common subsequence is \"abc\" and its length is 3.\n",
34 | "\n",
35 | "*Example 3:*
\n",
36 | "Input: text1 = \"abc\", text2 = \"def\"
\n",
37 | "Output: 0
\n",
38 | "Explanation: There is no such common subsequence, so the result is 0.\n",
39 | " \n",
40 | "*Constraints:*\n",
41 | "* 1 <= text1.length, text2.length <= 1000\n",
42 | "* text1 and text2 consist of only lowercase English characters.\n",
43 | "\n",
44 | "### Solution
\n",
45 | "To understand the problem statement and solution: https://www.youtube.com/watch?v=sSno9rV8Rhg\n",
46 | "\n",
47 | "Longest Common Subsequence Problem can be solved using\n",
48 | "1. **Recursion :** Time complexity of $O(2^n)$ where n is the max(A.length, B.length)\n",
49 | "\n",
50 | "```\n",
51 | "int LCS(int i, int j) :\n",
52 | " if A[i] == '\\0' or B[i] == '\\0:\n",
53 | " return 0\n",
54 | " elif A[i] == B[j]:\n",
55 | " return 1 + LCS(i+1, j+1)\n",
56 | " else:\n",
57 | " return max(LCS(i+1, j), LCS(i, j+1))\n",
58 | "```\n",
59 | "*** \n",
60 | "2. **Memoization :** In computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.
\n",
61 | " While solving using the recursion method, we can track of the return value because after some time in top-down tree which is maked using recursion call some part of tree is repeated ie. overlapping. So no need to compute the values again.\n",
62 | "\n",
63 | "```\n",
64 | "str1 = \"XMJYAUZ”\n",
65 | "str2 = “MZJAWXU\"\n",
66 | "\n",
67 | "----------0\t1\t2\t3\t4\t5\t6\t7\n",
68 | "----------Ø\tM\tZ\tJ\tA\tW\tX\tU\n",
69 | "0\tØ\t0\t0\t0\t0\t0\t0\t0\t0\n",
70 | "1\tX\t0\t0\t0\t0\t0\t0\t1\t1\n",
71 | "2\tM\t0\t1\t1\t1\t1\t1\t1\t1\n",
72 | "3\tJ\t0\t1\t1\t2\t2\t2\t2\t2\n",
73 | "4\tY\t0\t1\t1\t2\t2\t2\t2\t2\n",
74 | "5\tA\t0\t1\t1\t2\t3\t3\t3\t3\n",
75 | "6\tU\t0\t1\t1\t2\t3\t3\t3\t4\n",
76 | "7\tZ\t0\t1\t2\t2\t3\t3\t3\t4\n",
77 | "```\n",
78 | "***\n",
79 | "3. **Dynamic Programming :** Time complexity of $O(m*n)$\n",
80 | "\n",
81 | "Implemented below is the DP approach."
82 | ]
83 | },
84 | {
85 | "cell_type": "code",
86 | "execution_count": 1,
87 | "metadata": {},
88 | "outputs": [
89 | {
90 | "name": "stdout",
91 | "output_type": "stream",
92 | "text": [
93 | "3\n"
94 | ]
95 | }
96 | ],
97 | "source": [
98 | "class Solution(object):\n",
99 | " def longestCommonSubsequence(self, text1, text2):\n",
100 | " \"\"\"\n",
101 | " :type text1: str\n",
102 | " :type text2: str\n",
103 | " :rtype: int\n",
104 | " \"\"\"\n",
105 | " #length of s1 and s2\n",
106 | " m, n = len(text1), len(text2)\n",
107 | "\n",
108 | " #now using memoization\n",
109 | " prev, cur = [0]*(n+1), [0]*(n+1)\n",
110 | "\n",
111 | " for i in range(1, m+1):\n",
112 | " for j in range(1, n+1):\n",
113 | " if text1[i-1] == text2[j-1]:\n",
114 | " cur[j] = 1 + prev[j-1]\n",
115 | " else:\n",
116 | " if cur[j-1] > prev[j]:\n",
117 | " cur[j] = cur[j-1]\n",
118 | " else:\n",
119 | " cur[j] = prev[j]\n",
120 | " cur, prev = prev, cur\n",
121 | "\n",
122 | " return prev[n]\n",
123 | "\n",
124 | "\n",
125 | "if __name__ == '__main__':\n",
126 | " obj = Solution()\n",
127 | " s1 = 'longest'\n",
128 | " s2 = 'stone'\n",
129 | " #here LCS string is 'one'\n",
130 | " print(obj.longestCommonSubsequence(s1, s2))"
131 | ]
132 | },
133 | {
134 | "cell_type": "markdown",
135 | "metadata": {},
136 | "source": [
137 | "## 322. Coin Change\n",
138 | "You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.\n",
139 | "\n",
140 | "Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.\n",
141 | "\n",
142 | "You may assume that you have an infinite number of each kind of coin.\n",
143 | "\n",
144 | " \n",
145 | "*Example 1:*
\n",
146 | "Input: coins = [1,2,5], amount = 11
\n",
147 | "Output: 3
\n",
148 | "Explanation: 11 = 5 + 5 + 1\n",
149 | "\n",
150 | "\n",
151 | "*Example 2:*
\n",
152 | "Input: coins = [2], amount = 3
\n",
153 | "Output: -1
\n",
154 | "\n",
155 | "\n",
156 | "*Example 3:*
\n",
157 | "Input: coins = [1], amount = 0
\n",
158 | "Output: 0\n",
159 | "\n",
160 | "\n",
161 | "*Example 4:*
\n",
162 | "Input: coins = [1], amount = 1
\n",
163 | "Output: 1\n",
164 | "\n",
165 | "\n",
166 | "*Example 5:*
\n",
167 | "Input: coins = [1], amount = 2
\n",
168 | "Output: 2\n",
169 | " \n",
170 | "\n",
171 | "*Constraints:*\n",
172 | "* 1 <= coins.length <= 12\n",
173 | "* $1 <= coins[i] <= 2^{31} - 1$\n",
174 | "* $0 <= amount <= 10^4$"
175 | ]
176 | },
177 | {
178 | "cell_type": "code",
179 | "execution_count": 17,
180 | "metadata": {},
181 | "outputs": [
182 | {
183 | "name": "stdout",
184 | "output_type": "stream",
185 | "text": [
186 | "9\n"
187 | ]
188 | }
189 | ],
190 | "source": [
191 | "class Solution(object):\n",
192 | " def coinChange(self, coins, amount):\n",
193 | " \"\"\"\n",
194 | " :type coins: List[int]\n",
195 | " :type amount: int\n",
196 | " :rtype: int\n",
197 | " \"\"\"\n",
198 | " # using DP of time complexity of O(m*n)\n",
199 | " c_size = len(coins)\n",
200 | " \n",
201 | " infy = float('inf')\n",
202 | " dp = [[0 for i in range(amount + 1)] for j in range(c_size + 1)]\n",
203 | " \n",
204 | " \n",
205 | " for i in range(c_size + 1):\n",
206 | " for j in range(amount + 1):\n",
207 | " if j == 0: dp[i][j] = 0\n",
208 | " \n",
209 | " elif i == 0: dp[i][j] = infy\n",
210 | " \n",
211 | " elif coins[i-1] > j: dp[i][j] = dp[i-1][j]\n",
212 | " \n",
213 | " else: dp[i][j] = min(1 + dp[i][j - coins[i-1]], dp[i-1][j])\n",
214 | " \n",
215 | " # print(dp)\n",
216 | " return dp[c_size][amount] if dp[c_size][amount] != infy else -1\n",
217 | "\n",
218 | "\n",
219 | "# main\n",
220 | "obj = Solution()\n",
221 | "coins = [1,3,4]\n",
222 | "amount = 34\n",
223 | "\n",
224 | "print(obj.coinChange(coins, amount))"
225 | ]
226 | }
227 | ],
228 | "metadata": {
229 | "kernelspec": {
230 | "display_name": "Python 3.8.10 64-bit",
231 | "language": "python",
232 | "name": "python3810jvsc74a57bd0916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
233 | },
234 | "language_info": {
235 | "codemirror_mode": {
236 | "name": "ipython",
237 | "version": 3
238 | },
239 | "file_extension": ".py",
240 | "mimetype": "text/x-python",
241 | "name": "python",
242 | "nbconvert_exporter": "python",
243 | "pygments_lexer": "ipython3",
244 | "version": "3.8.10"
245 | }
246 | },
247 | "nbformat": 4,
248 | "nbformat_minor": 4
249 | }
250 |
--------------------------------------------------------------------------------
/File Operation.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "id": "f5a44c98",
6 | "metadata": {},
7 | "source": [
8 | "# File Operations "
9 | ]
10 | },
11 | {
12 | "cell_type": "code",
13 | "execution_count": 1,
14 | "id": "cb30315f",
15 | "metadata": {},
16 | "outputs": [
17 | {
18 | "name": "stdout",
19 | "output_type": "stream",
20 | "text": [
21 | "Help on built-in function open in module io:\n",
22 | "\n",
23 | "open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)\n",
24 | " Open file and return a stream. Raise OSError upon failure.\n",
25 | " \n",
26 | " file is either a text or byte string giving the name (and the path\n",
27 | " if the file isn't in the current working directory) of the file to\n",
28 | " be opened or an integer file descriptor of the file to be\n",
29 | " wrapped. (If a file descriptor is given, it is closed when the\n",
30 | " returned I/O object is closed, unless closefd is set to False.)\n",
31 | " \n",
32 | " mode is an optional string that specifies the mode in which the file\n",
33 | " is opened. It defaults to 'r' which means open for reading in text\n",
34 | " mode. Other common values are 'w' for writing (truncating the file if\n",
35 | " it already exists), 'x' for creating and writing to a new file, and\n",
36 | " 'a' for appending (which on some Unix systems, means that all writes\n",
37 | " append to the end of the file regardless of the current seek position).\n",
38 | " In text mode, if encoding is not specified the encoding used is platform\n",
39 | " dependent: locale.getpreferredencoding(False) is called to get the\n",
40 | " current locale encoding. (For reading and writing raw bytes use binary\n",
41 | " mode and leave encoding unspecified.) The available modes are:\n",
42 | " \n",
43 | " ========= ===============================================================\n",
44 | " Character Meaning\n",
45 | " --------- ---------------------------------------------------------------\n",
46 | " 'r' open for reading (default)\n",
47 | " 'w' open for writing, truncating the file first\n",
48 | " 'x' create a new file and open it for writing\n",
49 | " 'a' open for writing, appending to the end of the file if it exists\n",
50 | " 'b' binary mode\n",
51 | " 't' text mode (default)\n",
52 | " '+' open a disk file for updating (reading and writing)\n",
53 | " 'U' universal newline mode (deprecated)\n",
54 | " ========= ===============================================================\n",
55 | " \n",
56 | " The default mode is 'rt' (open for reading text). For binary random\n",
57 | " access, the mode 'w+b' opens and truncates the file to 0 bytes, while\n",
58 | " 'r+b' opens the file without truncation. The 'x' mode implies 'w' and\n",
59 | " raises an `FileExistsError` if the file already exists.\n",
60 | " \n",
61 | " Python distinguishes between files opened in binary and text modes,\n",
62 | " even when the underlying operating system doesn't. Files opened in\n",
63 | " binary mode (appending 'b' to the mode argument) return contents as\n",
64 | " bytes objects without any decoding. In text mode (the default, or when\n",
65 | " 't' is appended to the mode argument), the contents of the file are\n",
66 | " returned as strings, the bytes having been first decoded using a\n",
67 | " platform-dependent encoding or using the specified encoding if given.\n",
68 | " \n",
69 | " 'U' mode is deprecated and will raise an exception in future versions\n",
70 | " of Python. It has no effect in Python 3. Use newline to control\n",
71 | " universal newlines mode.\n",
72 | " \n",
73 | " buffering is an optional integer used to set the buffering policy.\n",
74 | " Pass 0 to switch buffering off (only allowed in binary mode), 1 to select\n",
75 | " line buffering (only usable in text mode), and an integer > 1 to indicate\n",
76 | " the size of a fixed-size chunk buffer. When no buffering argument is\n",
77 | " given, the default buffering policy works as follows:\n",
78 | " \n",
79 | " * Binary files are buffered in fixed-size chunks; the size of the buffer\n",
80 | " is chosen using a heuristic trying to determine the underlying device's\n",
81 | " \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n",
82 | " On many systems, the buffer will typically be 4096 or 8192 bytes long.\n",
83 | " \n",
84 | " * \"Interactive\" text files (files for which isatty() returns True)\n",
85 | " use line buffering. Other text files use the policy described above\n",
86 | " for binary files.\n",
87 | " \n",
88 | " encoding is the name of the encoding used to decode or encode the\n",
89 | " file. This should only be used in text mode. The default encoding is\n",
90 | " platform dependent, but any encoding supported by Python can be\n",
91 | " passed. See the codecs module for the list of supported encodings.\n",
92 | " \n",
93 | " errors is an optional string that specifies how encoding errors are to\n",
94 | " be handled---this argument should not be used in binary mode. Pass\n",
95 | " 'strict' to raise a ValueError exception if there is an encoding error\n",
96 | " (the default of None has the same effect), or pass 'ignore' to ignore\n",
97 | " errors. (Note that ignoring encoding errors can lead to data loss.)\n",
98 | " See the documentation for codecs.register or run 'help(codecs.Codec)'\n",
99 | " for a list of the permitted encoding error strings.\n",
100 | " \n",
101 | " newline controls how universal newlines works (it only applies to text\n",
102 | " mode). It can be None, '', '\\n', '\\r', and '\\r\\n'. It works as\n",
103 | " follows:\n",
104 | " \n",
105 | " * On input, if newline is None, universal newlines mode is\n",
106 | " enabled. Lines in the input can end in '\\n', '\\r', or '\\r\\n', and\n",
107 | " these are translated into '\\n' before being returned to the\n",
108 | " caller. If it is '', universal newline mode is enabled, but line\n",
109 | " endings are returned to the caller untranslated. If it has any of\n",
110 | " the other legal values, input lines are only terminated by the given\n",
111 | " string, and the line ending is returned to the caller untranslated.\n",
112 | " \n",
113 | " * On output, if newline is None, any '\\n' characters written are\n",
114 | " translated to the system default line separator, os.linesep. If\n",
115 | " newline is '' or '\\n', no translation takes place. If newline is any\n",
116 | " of the other legal values, any '\\n' characters written are translated\n",
117 | " to the given string.\n",
118 | " \n",
119 | " If closefd is False, the underlying file descriptor will be kept open\n",
120 | " when the file is closed. This does not work when a file name is given\n",
121 | " and must be True in that case.\n",
122 | " \n",
123 | " A custom opener can be used by passing a callable as *opener*. The\n",
124 | " underlying file descriptor for the file object is then obtained by\n",
125 | " calling *opener* with (*file*, *flags*). *opener* must return an open\n",
126 | " file descriptor (passing os.open as *opener* results in functionality\n",
127 | " similar to passing None).\n",
128 | " \n",
129 | " open() returns a file object whose type depends on the mode, and\n",
130 | " through which the standard file operations such as reading and writing\n",
131 | " are performed. When open() is used to open a file in a text mode ('w',\n",
132 | " 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open\n",
133 | " a file in a binary mode, the returned class varies: in read binary\n",
134 | " mode, it returns a BufferedReader; in write binary and append binary\n",
135 | " modes, it returns a BufferedWriter, and in read/write mode, it returns\n",
136 | " a BufferedRandom.\n",
137 | " \n",
138 | " It is also possible to use a string or bytearray as a file for both\n",
139 | " reading and writing. For strings StringIO can be used like a file\n",
140 | " opened in a text mode, and for bytes a BytesIO can be used like a file\n",
141 | " opened in a binary mode.\n",
142 | "\n"
143 | ]
144 | }
145 | ],
146 | "source": [
147 | "help(open)"
148 | ]
149 | },
150 | {
151 | "cell_type": "code",
152 | "execution_count": 2,
153 | "id": "eb55cd3e",
154 | "metadata": {},
155 | "outputs": [
156 | {
157 | "name": "stdout",
158 | "output_type": "stream",
159 | "text": [
160 | "Enter file data and b to break process:\n",
161 | "Have faith and patience\n",
162 | "Rest in hand of THE God\n",
163 | "b\n"
164 | ]
165 | }
166 | ],
167 | "source": [
168 | "def fileWrite(file_name = \"file.txt\"):\n",
169 | " fh = open(file_name, \"w\")\n",
170 | " print(\"Enter file data and b to break process:\")\n",
171 | " while True:\n",
172 | " inp = input()\n",
173 | " if inp == \"b\":\n",
174 | " break\n",
175 | " fh.write(inp+\"\\n\")\n",
176 | " fh.close() # We can use Context Managers for file closing, check Tip & Tricks notebook\n",
177 | " \n",
178 | "#main\n",
179 | "fileWrite()"
180 | ]
181 | },
182 | {
183 | "cell_type": "code",
184 | "execution_count": 3,
185 | "id": "be0c4627",
186 | "metadata": {},
187 | "outputs": [
188 | {
189 | "name": "stdout",
190 | "output_type": "stream",
191 | "text": [
192 | "Reading the file.....\n",
193 | "$ $ , . $ & ( / # % \n",
194 | "Have faith and patience\n",
195 | "Rest in hand of THE God\n",
196 | "\n"
197 | ]
198 | }
199 | ],
200 | "source": [
201 | "from time import sleep\n",
202 | "from random import randint\n",
203 | "\n",
204 | "\n",
205 | "RAND_SPE_ASCII_START = 33\n",
206 | "RAND_SPE_ASCII_END = 47\n",
207 | "\n",
208 | "\n",
209 | "def fileRead(file_name = \"file.txt\"):\n",
210 | " fh = open(file_name, \"r\")\n",
211 | " print(\"Reading the file.....\")\n",
212 | " \n",
213 | " #GUI effects for reading\n",
214 | " for i in range(10):\n",
215 | " print(chr(randint(RAND_SPE_ASCII_START, RAND_SPE_ASCII_END)), end=\" \")\n",
216 | " sleep(1) #main thread sleep for 1 second\n",
217 | " \n",
218 | " print()\n",
219 | " print(fh.read())\n",
220 | " fh.close()\n",
221 | " \n",
222 | "#main\n",
223 | "fileRead()"
224 | ]
225 | }
226 | ],
227 | "metadata": {
228 | "kernelspec": {
229 | "display_name": "Python 3 (ipykernel)",
230 | "language": "python",
231 | "name": "python3"
232 | },
233 | "language_info": {
234 | "codemirror_mode": {
235 | "name": "ipython",
236 | "version": 3
237 | },
238 | "file_extension": ".py",
239 | "mimetype": "text/x-python",
240 | "name": "python",
241 | "nbconvert_exporter": "python",
242 | "pygments_lexer": "ipython3",
243 | "version": "3.10.5"
244 | }
245 | },
246 | "nbformat": 4,
247 | "nbformat_minor": 5
248 | }
249 |
--------------------------------------------------------------------------------
/Flask API.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "id": "641360c7",
6 | "metadata": {},
7 | "source": [
8 | "# Flask API \n"
9 | ]
10 | },
11 | {
12 | "cell_type": "markdown",
13 | "id": "e7232c0e",
14 | "metadata": {},
15 | "source": [
16 | "* REST: Representational State Transfer\n",
17 | "* REST APIs are stateless because, rather than relying on the server remembering previous requests, REST applications require each request to contain all of the information necessary for the server to understand it. Storing session state on the server violates the REST architecture's stateless requirement.\n",
18 | "* REST is independent of platform and languages.\n",
19 | "* REST is not constrained to one format. Can return XML, JSON, YAML etc.\n",
20 | "* SOAP: Simple Object Access Protocol \n",
21 | "* SOAP is by default stateless, but it is possible to make this API stateful.\n",
22 | "* REST constraints:\n",
23 | " 1. Client-Server: Client need not to know anything about business/data acess layer and server need not to know anything about web UI.\n",
24 | " 2. Stateless: Server doesn't need to store any session data.\n",
25 | " 3. Cache: Response should be cacheable, if possible. Reduce latency.\n",
26 | " 4. Uniform Interface: Should work same as mobile, laptop etc.\n",
27 | " 5. Layered System: Should have hierarchical layer, and each layer should not know anything beyond immediate layer. Example as MVP architecture.\n",
28 | "* Installation:\n",
29 | "```\n",
30 | "!pip install flask-restful\n",
31 | "```"
32 | ]
33 | },
34 | {
35 | "cell_type": "markdown",
36 | "id": "039a550d",
37 | "metadata": {},
38 | "source": [
39 | "### API building blocks\n",
40 | "\n",
41 | "* Following Steps are involved in developing a simple API :\n",
42 | " 1. Definition of a class derived from Resource Class. This is the major part of building a REST API.\n",
43 | " + A resource in REST is similar to object in Object Oriented Programming or is like an Entity in a Database. \n",
44 | " + Resource class represents an abstract RESTful resource.\n",
45 | " + Concrete resources should extend from this class and expose methods for each supported HTTP method.\n",
46 | " + If a resource is invoked with an unsupported HTTP method, the API will return a response with status 405 Method Not Allowed.\n",
47 | " 2. Definition one or more methods, corresponding to HTTP methods, inside derived Class. The allowed methods are get, put, post, and delete.\n",
48 | " 3. Map the resource class with one or more URL's using add_resource function.\n",
49 | "* HTTP request methods:\n",
50 | " + Create NEW record => POST.\n",
51 | " + read => GET.\n",
52 | " + if the record exists then update else create a new record => PUT.\n",
53 | " + update/modify => PATCH.\n",
54 | " + delete => DELETE."
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": null,
60 | "id": "94fa19af",
61 | "metadata": {
62 | "scrolled": false
63 | },
64 | "outputs": [],
65 | "source": [
66 | "from flask import Flask\n",
67 | "from flask_restful import Api, Resource\n",
68 | "\n",
69 | "app = Flask(__name__)\n",
70 | "api = Api(app)\n",
71 | "\n",
72 | "\n",
73 | "class MessageSender(Resource):\n",
74 | " def get(self):\n",
75 | " return (\n",
76 | " {'msg': 'Hello from flask'}, # response\n",
77 | " 200, # status code\n",
78 | " {'my_header': 'Playing with flask'} # header \n",
79 | " )\n",
80 | "\n",
81 | "api.add_resource(MessageSender, '/') \n",
82 | "# to assign multiple url\n",
83 | "# api.add_resource(HelloFresco, '/', '/home/', '/index/')\n",
84 | "\n",
85 | "if __name__ == '__main__':\n",
86 | " app.run()"
87 | ]
88 | },
89 | {
90 | "cell_type": "markdown",
91 | "id": "13bd7651",
92 | "metadata": {},
93 | "source": [
94 | "### Accessing REST API\n",
95 | "\n",
96 | "* Now open a new terminal and send a GET request using curl as shown below.\n",
97 | "\n",
98 | "```\n",
99 | "$ curl http://127.0.0.1:5000/\n",
100 | "```\n",
101 | "\n",
102 | "* The above HTTP GET request is processed and response will be send.\n",
103 | "* Or copy-paste the url to browser to see the response.\n",
104 | "* It is also possible to access REST API using `request` module of `urllib` package.\n",
105 | "\n",
106 | "```\n",
107 | "from urllib import request\n",
108 | "req = request.Request('http://127.0.0.1:5000/')\n",
109 | "\n",
110 | "try:\n",
111 | " response = request.urlopen(req)\n",
112 | " print(response.read())\n",
113 | "except urllib.error.HTTPError as e:\n",
114 | " print(e.code, e.read())\n",
115 | "```\n"
116 | ]
117 | },
118 | {
119 | "cell_type": "markdown",
120 | "id": "dadce565",
121 | "metadata": {},
122 | "source": [
123 | "### Mapping Multiple URL's\n",
124 | "\n",
125 | "* A single Resource can be mapped to one or more URL's.\n",
126 | "* Multiple URL's can be passed to add_resource method of Api object.\n",
127 | "```\n",
128 | "api.add_resource(HelloFresco, '/', '/home/', '/index/')\n",
129 | "```\n",
130 | "* Now this url also work `http://127.0.0.1:5000/home/`"
131 | ]
132 | },
133 | {
134 | "cell_type": "markdown",
135 | "id": "e932f4f4",
136 | "metadata": {},
137 | "source": [
138 | "### Common Status Codes\n",
139 | "\n",
140 | "* 1xx: Informational – Communicates transfer protocol-level information.\n",
141 | "* 2xx: Success – Indicates that the client’s request was accepted successfully.\n",
142 | "* 3xx: Redirection – Indicates that the client must take some additional action in order to complete their request.\n",
143 | "* 4xx: Client Error – This category of error status codes points the finger at clients.\n",
144 | "* 5xx: Server Error – The server takes responsibility for these error status codes.\n",
145 | "
\n",
146 | "\n",
147 | "* 200 OK: Indicates that the request has succeeded.\n",
148 | "* 201 Created: Indicates that the request has succeeded and a new resource has been created as a result.\n",
149 | "
\n",
150 | "\n",
151 | "* 300 Multiple Choices: The request has more than one possible response. The user-agent or user should choose one of them.\n",
152 | "* 301 Moved Permanently: The URL of the requested resource has been changed permanently. The new URL is given by the Location header field in the response. This response is cacheable unless indicated otherwise.\n",
153 | "
\n",
154 | "\n",
155 | "* 400 Bad Request: The request could not be understood by the server due to incorrect syntax. The client SHOULD NOT repeat the request without modifications.\n",
156 | "* 401 Unauthorized: Indicates that the request requires user authentication information. The client MAY repeat the request with a suitable Authorization header field\n",
157 | "* 404 Not Found: The server can not find the requested resource.\n",
158 | "* 405 Method Not Allowed: The request HTTP method is known by the server but has been disabled and cannot be used for that resource.\n",
159 | "* 408 Request Timeout: Indicates that the server did not receive a complete request from the client within the server’s allotted timeout period.\n",
160 | "
\n",
161 | "\n",
162 | "* 500 Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request.\n",
163 | "* 501 Not Implemented: The HTTP method is not supported by the server and cannot be handled.\n",
164 | "* 502 Bad Gateway: The server got an invalid response while working as a gateway to get the response needed to handle the request.\n",
165 | "* 503 Service Unavailable: The server is not ready to handle the request.\n",
166 | "* 504 Gateway Timeout: The server is acting as a gateway and cannot get a response in time for a request."
167 | ]
168 | },
169 | {
170 | "cell_type": "markdown",
171 | "id": "5a86672a",
172 | "metadata": {},
173 | "source": [
174 | " ### Setting Response Status and Headers\n",
175 | "\n",
176 | "* Below example shows how to set response, status and header:\n",
177 | "```\n",
178 | " class HelloFresco(Resource):\n",
179 | " def get(self):\n",
180 | " return {'message': 'Welcome to Fresco Play!!!'}, 201, {'response_header1': 'some-message'}\n",
181 | "```\n",
182 | "\n",
183 | "* To see status code and header in browser: _right-click_ > _inspect_ > _network_\n",
184 | " \n",
185 | " \n",
186 | "* The logic that Flask applies to converting return values into response objects is as follows:\n",
187 | " 1. If a response object of the correct type is returned it’s directly returned from the view.\n",
188 | " 2. If it’s a `string`, a response object is created with that data and the default parameters.\n",
189 | " 3. If it’s a `dict`, a response object is created using jsonify.\n",
190 | " 4. If a `tuple` is returned the items in the tuple can provide extra information. Such tuples have to be in the form `(response, status), (response, headers), or (response, status, headers)`. The status value will override the status code and headers can be a list or dictionary of additional header values.\n",
191 | " 5. If none of that works, Flask will assume the return value is a valid WSGI application and convert that into a response object."
192 | ]
193 | },
194 | {
195 | "cell_type": "markdown",
196 | "id": "00e1545a",
197 | "metadata": {},
198 | "source": [
199 | "### Request Module\n",
200 | "\n",
201 | "* Attributes available on the request object (_from flask import request_) during a request.\n",
202 | " * `request.data`: contains the incoming request data as string in case it came with a mimetype Flask does not handle.\n",
203 | " * `request.args`: the key/value pairs in the URL query string\n",
204 | " * `request.form`: the key/value pairs in the body, from a HTML post form, or JavaScript request that isn't JSON encoded\n",
205 | " * `request.files`: the files in the body, which Flask keeps separate from form. HTML forms must use enctype=multipart/form-data or files will not be uploaded.\n",
206 | " * `request.values`: combined args and form, preferring args if keys overlap\n",
207 | " * `request.json`: parsed JSON data. The request must have the application/json content type, or use request.get_json(force=True) to ignore the content type.\n",
208 | "\n",
209 | "* All of these are MultiDict instances (except for json). You can access values using:\n",
210 | " * `request.form['name']`: use indexing if you know the key exists\n",
211 | " * `request.form.get('name')`: use get if the key might not exist\n",
212 | " * `request.form.getlist('name')`: use getlist if the key is sent multiple times and you want a list of values. get only returns the first value."
213 | ]
214 | },
215 | {
216 | "cell_type": "markdown",
217 | "id": "b187f3c8",
218 | "metadata": {},
219 | "source": [
220 | "### Building a Basic CRUD Resource \n",
221 | "\n",
222 | "* Below code act as Server / Backend.\n",
223 | "* It will receives the request and send the response.\n",
224 | "* To hit the api or client-side approach:\n",
225 | " * Use Edge Browser extension `Boomerang` for sending get/put/post/delete request, same as postman.\n",
226 | " * It will send the request and receive the response.\n",
227 | " * Form should be used while sending request as in server-side `request.form` used."
228 | ]
229 | },
230 | {
231 | "cell_type": "code",
232 | "execution_count": null,
233 | "id": "d7ce0baa",
234 | "metadata": {},
235 | "outputs": [],
236 | "source": [
237 | "from flask import Flask, request\n",
238 | "from flask_restful import Api, Resource, abort\n",
239 | "\n",
240 | "\n",
241 | "# this will act as database\n",
242 | "course_db = dict()\n",
243 | "\n",
244 | "app = Flask(__name__)\n",
245 | "api = Api(app)\n",
246 | "\n",
247 | "\n",
248 | "class Courses(Resource):\n",
249 | " \"\"\"\n",
250 | " Class that extends from Resource class, and having functionality to\n",
251 | " create, read, ulter and delete.\n",
252 | " \"\"\"\n",
253 | " \n",
254 | " def post(self, course_id):\n",
255 | " \"\"\"\n",
256 | " Post method to create new records.\n",
257 | " \"\"\"\n",
258 | " if course_id in course_db.keys():\n",
259 | " abort(404, message=\"Course_Id {} already exists.\".format(course_id))\n",
260 | " course_db[course_id] = request.form['course_name']\n",
261 | " return (\n",
262 | " {'message': f'Course created for course_id {course_id}: {course_db[course_id]}.'},\n",
263 | " 201,\n",
264 | " )\n",
265 | " \n",
266 | " def get(self, course_id=None):\n",
267 | " \"\"\"\n",
268 | " Get method to read the record based on course_id.\n",
269 | " \"\"\"\n",
270 | " if course_id is None:\n",
271 | " return {'message': course_db}, 200\n",
272 | " elif course_id not in course_db.keys():\n",
273 | " abort(404, message=f\"Course_Id: {course_id} not exists.\")\n",
274 | " return (\n",
275 | " {'message': f'Course_id {course_id} is map to {course_db[course_id]}.'},\n",
276 | " 200,\n",
277 | " )\n",
278 | " \n",
279 | " def put(self, course_id):\n",
280 | " \"\"\"\n",
281 | " Put method to alter the exist record based on course_id.\n",
282 | " \"\"\"\n",
283 | " if course_id not in course_db.keys():\n",
284 | " abort(404, message=f\"Course_Id: {course_id} not exists.\")\n",
285 | " course_db[course_id] = request.form['course_name']\n",
286 | " return (\n",
287 | " {'message': f'Course alter for course_id {course_id}: {course_db[course_id]}.'},\n",
288 | " 200,\n",
289 | " )\n",
290 | " \n",
291 | " def delete(self, course_id):\n",
292 | " \"\"\"\n",
293 | " Delete method to remove the record based on course_id.\n",
294 | " \"\"\"\n",
295 | " if course_id not in course_db.keys():\n",
296 | " abort(404, message=f\"Course_Id: {course_id} not exists.\")\n",
297 | " course_name = course_db.pop(course_id)\n",
298 | " return (\n",
299 | " {'message': f'Course {course_name} with course_id {course_id}, removed successfully.'},\n",
300 | " 200,\n",
301 | " )\n",
302 | " \n",
303 | " \n",
304 | "api.add_resource(Courses, '/Courses/', '/Courses/')\n",
305 | "\n",
306 | "\n",
307 | "if __name__ == '__main__':\n",
308 | " app.run()"
309 | ]
310 | },
311 | {
312 | "cell_type": "markdown",
313 | "id": "ec720616",
314 | "metadata": {},
315 | "source": [
316 | "### Parsing Requests\n",
317 | "\n",
318 | "* We will see how to validate the data sent over a HTTP request using `reqparse` module of `flask_restful`.\n",
319 | "* The utilities of reqparse module are modelled based on `argparse` module.\n",
320 | "* For using reqparse, an instance of `RequestParser` class has to be created first.\n",
321 | "* Later, expected data arguments have to be added to created parser.\n",
322 | "* Many parameters, such as type, required, help, location can be set while adding an argument.\n",
323 | "* Value associated with any argument can be accessed using dictionary, returned by `parse_args` method of created instance.\n",
324 | "* An example of creating parser and adding an argument argument1 is shown below.\n",
325 | "```\n",
326 | " from flask_restful import reqparse\n",
327 | "\n",
328 | " parser = reqparse.RequestParser()\n",
329 | " parser.add_argument('argument1', type=int, help='This argument must be an integer', location='form')\n",
330 | " args = parser.parse_args() # 'args' is a dictionary\n",
331 | "```\n",
332 | "* Suppose below code is server-side code and if client send `principal_amount='hello'`. Since hello cannot be converted to a float type, the response would thrown an error as `500 b'{\"message\": \"Internal Server Error\"}\\n'`\n",
333 | "```\n",
334 | " from flask import Flask, request\n",
335 | " from flask_restful import Api, Resource, abort\n",
336 | "\n",
337 | " app = Flask(__name__)\n",
338 | " api = Api(app)\n",
339 | "\n",
340 | " class SimpleInterest(Resource):\n",
341 | " def post(self):\n",
342 | " principal = float(request.form['principal_amount']) # if principal_amount='hello', error will be thrown\n",
343 | " rate = float(request.form['rate'])\n",
344 | " time = int(request.form['time'])\n",
345 | " return {'simple_interest': principal*rate*time/100.0}\n",
346 | "\n",
347 | " api.add_resource(SimpleInterest, '/SimpleInterest')\n",
348 | "```\n",
349 | "* By default, RequestParser aborts when it encounters the first error.\n",
350 | "* However, it is possible to combine all errors together and send them at once to client.\n",
351 | "* It can be achieved by setting `bundle_errors` parameter of RequestParser class to True, while creating it's object, as shown below.\n",
352 | "```\n",
353 | "parser = reqparse.RequestParser(bundle_errors=True)\n",
354 | "```\n",
355 | "* In order to validate the data, passed via HTTP requests, let's modify definition of SimpleInterest resource as shown below.\n",
356 | "* Now if client send principal_amount='hello' and time=5.5, meaningfull error will be thrown \n",
357 | "```\n",
358 | "400 b'{\"message\": {\"time\": \"No. of Years must be an integer\", \"principal_amount\": \"Principal amount must be a number\"}}\\n'\n",
359 | "```\n",
360 | "* If an argument needs to take any one value from a list of defined choices, it can be done using choices parameter of add_argument method.\n",
361 | "```\n",
362 | "parser.add_argument(\n",
363 | " 'year',\n",
364 | " choices=('2017', '2018', '2019', '2020'),\n",
365 | " help='Bad choice', location='form'\n",
366 | ")\n",
367 | "```"
368 | ]
369 | },
370 | {
371 | "cell_type": "code",
372 | "execution_count": null,
373 | "id": "0186d95d",
374 | "metadata": {},
375 | "outputs": [],
376 | "source": [
377 | "from flask import Flask, request\n",
378 | "from flask_restful import Api, Resource, reqparse, abort\n",
379 | "\n",
380 | "app = Flask(__name__)\n",
381 | "api = Api(app)\n",
382 | "\n",
383 | "parser = reqparse.RequestParser(bundle_errors=True)\n",
384 | "parser.add_argument('principal_amount', type=float, help='Principal amount must be a number', location='form')\n",
385 | "parser.add_argument('time', type=int, help=\"No. of Years must be an integer\", location='form')\n",
386 | "parser.add_argument('rate', type=float, help='Rate must be a number', location='form', required=True)\n",
387 | "\n",
388 | "\n",
389 | "class SimpleInterest(Resource):\n",
390 | " def post(self):\n",
391 | " args = parser.parse_args()\n",
392 | " principal = args['principal_amount']\n",
393 | " time = args['time']\n",
394 | " rate = args['rate']\n",
395 | " return {'simple_interest': principal*rate*time/100.0}\n",
396 | "\n",
397 | "api.add_resource(SimpleInterest, '/SimpleInterest')\n",
398 | "\n",
399 | "if __name__ == '__main__':\n",
400 | " app.run()"
401 | ]
402 | },
403 | {
404 | "cell_type": "markdown",
405 | "id": "66241f25",
406 | "metadata": {},
407 | "source": [
408 | "#### Parser Inheritance\n",
409 | "\n",
410 | "* Many a times, you may define a different parser for each defined resource.\n",
411 | "* Some of the resources may have common arguments.\n",
412 | "* In such a scenario, it is good to define a parent parser having shared argument details.\n",
413 | "* The parent parser can be further extended using `copy` method.\n",
414 | "* Any argument in parent parser can be overwritten using `replace_argument` method and can be completely removed using `remove_argument` method.\n",
415 | "```\n",
416 | " parser = reqparse.RequestParser()\n",
417 | " parser.add_argument('arg1', type=int)\n",
418 | "\n",
419 | " parser_copy = parser.copy()\n",
420 | " parser_copy.add_argument('arg2', type=int)\n",
421 | "\n",
422 | " parser_copy.replace_argument('arg1', required=True)\n",
423 | "```"
424 | ]
425 | },
426 | {
427 | "cell_type": "markdown",
428 | "id": "ab7d486f",
429 | "metadata": {},
430 | "source": [
431 | "### Formatting Response Data\n",
432 | "\n",
433 | "* By default, if the iterable returned by any of the methods defined in a Resource class is a Python Data Structure, then it is rendered as it is.\n",
434 | "* However, if an other object is returned, the rendering may not be as expected.\n",
435 | "* As a reason, `flask_restful` provides `fields` module to specify the structure of response.\n",
436 | "* Structure of a response must be either a dictionary or an Ordered dictionary.\n",
437 | "* Different Field Types:\n",
438 | " | Field Name | Description |\n",
439 | " | :- | :- |\n",
440 | " | fields.Raw | Base field class, from which custom fields can be derived\n",
441 | " | fields.String | Outputs a value as String\n",
442 | " | fields.Float | Outputs a value as Float\n",
443 | " | fields.Integer | Outputs a value as Integer\n",
444 | " | fields.Boolean | Outputs a value as a Boolean\n",
445 | " | fields.Url | Outputs an URL in a string form\n",
446 | " | fields.DateTime | Returns a formated datetime string in UTC\n",
447 | "\n",
448 | "\n",
449 | "#### Marshalling\n",
450 | "\n",
451 | "* Pickling and marshalling is almost same in python. It is used in serializing and deserializing a Python object structure or in other words the process of converting a Python object into a byte stream.\n",
452 | "* Flask-restful also comes with methods like `marshal`, `marshal_with` and `marshal_with_field`, which are useful for filtering the response data from return values of methods.\n",
453 | "* `marshal` method of Flask-RESTful package provides the ability to filter data of specified fields in a desired format.\n",
454 | "* `marshal` method takes either a dictionary, list, or an object as input of data and a dictionary of fields, to be available in output, and filters the data based on those fields.\n",
455 | "* In addition to marshal method, you can also use `marshal_with` decorator for marshalling the return object of a method with specified data fields.\n",
456 | "* `marshal_with_field` is an another decorator which formats return values of methods with a single field.\n",
457 | "\n",
458 | "\n",
459 | "#### Renaming Attributes\n",
460 | "\n",
461 | "* Any field name, displayed to users, can be altered from it's internal field name by renaming it.\n",
462 | "* Renaming an internal field name can be achieved by setting `attribute` parameter value, of any `field` type, to the _new public_ field name.\n",
463 | "* An example of using attribute is shown below. It renames field name, private_name to public_name.\n",
464 | "```\n",
465 | "fields = {\n",
466 | " 'public_name': fields.String(attribute='private_name'),\n",
467 | " 'address': fields.String,\n",
468 | " 'age':fields.Integer,\n",
469 | "}\n",
470 | "```\n",
471 | "\n",
472 | "\n",
473 | "#### Custom Fields\n",
474 | "\n",
475 | "* fields module can also be used to create custom fields.\n",
476 | "* A custom field has to be derived from `fields.Raw` class and must contain definition of format method.\n",
477 | "* In below example, LowerCase class is derived from fields.Raw class and it's format method transforms an input value into lower case.\n",
478 | "```\n",
479 | "class LowerCase(fields.Raw):\n",
480 | " def format(self, value):\n",
481 | " return value.lower()\n",
482 | "```"
483 | ]
484 | },
485 | {
486 | "cell_type": "code",
487 | "execution_count": null,
488 | "id": "027a8f09",
489 | "metadata": {},
490 | "outputs": [],
491 | "source": [
492 | "from flask_restful import marshal, marshal_with, marshal_with_field, fields\n",
493 | "\n",
494 | "\n",
495 | "data = {\n",
496 | " 'age': 36,\n",
497 | " 'name': 'Philips'\n",
498 | "}\n",
499 | "\n",
500 | "required_fields = {\n",
501 | " 'name': fields.Raw\n",
502 | "}\n",
503 | "\n",
504 | "print('marshal:', marshal(data, required_fields))\n",
505 | "\n",
506 | "\n",
507 | "\n",
508 | "@marshal_with(required_fields)\n",
509 | "def get():\n",
510 | " return data\n",
511 | "\n",
512 | "print('marshal_with:', get())\n",
513 | "\n",
514 | "\n",
515 | "@marshal_with_field(fields.List(fields.Integer))\n",
516 | "def get():\n",
517 | " return ['2', 5.023, 199]\n",
518 | "\n",
519 | "print('marshal_with_field:', get())"
520 | ]
521 | },
522 | {
523 | "cell_type": "code",
524 | "execution_count": null,
525 | "id": "34099cde",
526 | "metadata": {},
527 | "outputs": [],
528 | "source": [
529 | "from flask import Flask\n",
530 | "from datetime import datetime\n",
531 | "from flask_restful import Api, Resource, reqparse, request, marshal_with, fields\n",
532 | "\n",
533 | "\n",
534 | "app = Flask(__name__)\n",
535 | "api = Api(app)\n",
536 | "\n",
537 | "parser = reqparse.RequestParser()\n",
538 | "parser.add_argument('SI', type=float, required=True, location='form', help='Provide Simple Interest amount.')\n",
539 | "\n",
540 | "req_fields = {\n",
541 | " 'si_public': fields.Float(attribute='si_private'),\n",
542 | " 'computed_date': fields.DateTime(dt_format='rfc822')\n",
543 | "}\n",
544 | "\n",
545 | "\n",
546 | "class SimpleInterest(Resource):\n",
547 | " @marshal_with(req_fields)\n",
548 | " def post(self):\n",
549 | " args = parser.parse_args()\n",
550 | " si = args['SI']\n",
551 | " return {\n",
552 | " 'si_private': si, # in response si_public would be visible\n",
553 | " 'computed_date': datetime.now()\n",
554 | " }\n",
555 | "\n",
556 | "api.add_resource(SimpleInterest, '/simple')\n",
557 | "\n",
558 | "\n",
559 | "if __name__ == '__main__':\n",
560 | " app.run()"
561 | ]
562 | },
563 | {
564 | "cell_type": "markdown",
565 | "id": "4e8a88df",
566 | "metadata": {},
567 | "source": [
568 | "### Defining Constructor Parameters\n",
569 | "\n",
570 | "* In case if any resource has external dependencies, those dependencies can be passed to constructor method of the resource.\n",
571 | "* The below example shows definition of a sample Resource Task. The `__init__` method initializes `self.db` to a database connection object and get method uses execute method associated with connection object.\n",
572 | "```\n",
573 | " from flask_restful import Resource\n",
574 | "\n",
575 | " class Task(Resource):\n",
576 | " def __init__(self, **kwargs):\n",
577 | " self.db = kwargs['dbconnection']\n",
578 | "\n",
579 | " def get(self):\n",
580 | " return self.db.execute()\n",
581 | "```\n",
582 | "* The way of passing database connection object to Task is shown below.\n",
583 | "```\n",
584 | " db_connection = db.Connection()\n",
585 | "\n",
586 | " api.add_resource(TodoNext, '/next',\n",
587 | " resource_class_kwargs={ 'dbconnection': db_connection })\n",
588 | "```"
589 | ]
590 | },
591 | {
592 | "cell_type": "markdown",
593 | "id": "1e0db07a",
594 | "metadata": {},
595 | "source": [
596 | "### Structuring a Project\n",
597 | "\n",
598 | "* A Flask-restful app can be organised in multiple ways.\n",
599 | "* In this topic we will see one way of organizing an app, which is scalable well with larger apps.\n",
600 | "* In general, a project app is split into three sections: `routes`, `resources`, and `common` sections.\n",
601 | "* Files under `routes` section contains the app and definition of various routes.\n",
602 | "* Files under `resources` section contain definition of various resources.\n",
603 | "* Finally, files under `common` section contain definition of functions used across the application.\n",
604 | "```\n",
605 | " myprojectapi/\n",
606 | " __init__.py\n",
607 | " app.py\n",
608 | " resources/\n",
609 | " __init__.py \n",
610 | " hellofresco.py \n",
611 | " frescoplaycourses.py\n",
612 | " simpleinterest.py\n",
613 | " common/\n",
614 | " __init__.py\n",
615 | " utils.py\n",
616 | "```\n",
617 | "* The routes section contains the file app.py. Add the below shown content to it.\n",
618 | "* It defines a Flask application, app and a restful Api, api. The api is linked to application app.\n",
619 | "* Further the resources are imported from files in resources folder and added to api .\n",
620 | "```\n",
621 | " from flask import Flask\n",
622 | " from flask_restful import Api\n",
623 | " from myprojectapi.resources.hellofresco import HelloFresco\n",
624 | " from myprojectapi.resources.frescoplaycourses import PlayCourses\n",
625 | " from myprojectapi.resources.simple_interest import SimpleInterest\n",
626 | "\n",
627 | " app = Flask(__name__)\n",
628 | "\n",
629 | " api = Api(app)\n",
630 | " api.add_resource(HelloFresco, '/')\n",
631 | " api.add_resource(PlayCourses, '/Courses/', '/Courses/')\n",
632 | " api.add_resource(SimpleInterest, '/simpleinterest/')\n",
633 | "```\n",
634 | "* Files containing the definition of resources are placed in myprojectapi/resources folder .\n",
635 | "* Remove the following lines from all the three resource files.\n",
636 | " * Lines defining a flask app i.e `app = Flask(__name__)`.\n",
637 | " * Lines defining a flask restful api i.e `api = Api(app)`.\n",
638 | " * Lines adding resources to a api using `add_resource` method.\n",
639 | " * Block of lines used for running the applictaion i,e `app.run()`.\n",
640 | "* Required resources can be imported in myprojectapi/app.py and used.\n",
641 | "* Any new resource can be directly added to resources folder."
642 | ]
643 | },
644 | {
645 | "cell_type": "code",
646 | "execution_count": null,
647 | "id": "d1e14d3e",
648 | "metadata": {},
649 | "outputs": [],
650 | "source": []
651 | }
652 | ],
653 | "metadata": {
654 | "kernelspec": {
655 | "display_name": "Python 3 (ipykernel)",
656 | "language": "python",
657 | "name": "python3"
658 | },
659 | "language_info": {
660 | "codemirror_mode": {
661 | "name": "ipython",
662 | "version": 3
663 | },
664 | "file_extension": ".py",
665 | "mimetype": "text/x-python",
666 | "name": "python",
667 | "nbconvert_exporter": "python",
668 | "pygments_lexer": "ipython3",
669 | "version": "3.10.5"
670 | }
671 | },
672 | "nbformat": 4,
673 | "nbformat_minor": 5
674 | }
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Python_Notebooks
2 |
3 | This jupyter notebooks contains solution for various LeetCode problems (_https://leetcode.com/GekkoCode/_) and best DSA practices.
4 |
5 |
6 | **Topics covered from Explore cards (LeetCode):**
7 | - [ ] Strings and Arrays
8 | - [ ] Linked List
9 | - [ ] Arrays 101
10 | - [ ] Stacks & Queues
11 |
12 | **Additional notebooks:**
13 | - [ ] Tips and Tricks for Python
14 | + Iterators
15 | + Generators
16 | + Coroutine
17 | + Decorators
18 | * Closure
19 | + Descriptors
20 | + Class and static methods
21 | + Abstract Base Classes
22 | + Context Managers
23 | + Inheritance
24 | + Abstraction
25 | + operator module
26 | + from functools import lru_cache (memoize)
27 | - [ ] Jupyter notebook formatting syntax
28 | - [ ] Algorithms and Methodology (contains algo)
29 | - [ ] File Operations in Python
30 | - [ ] Database API in Python
31 | - [ ] NumPy
32 | - [ ] Pandas -I
33 | - [ ] Pandas - II
34 | - [ ] Data Visualization with Matplotlib
35 | - [ ] EDA on Sleep
36 | - [ ] EDA on Weather
37 | - [ ] Cryptocurrency - EDA & Visualization Fresco
38 | - [ ] Facebook - EDA Fresco
39 |
--------------------------------------------------------------------------------
/Rough Work.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": null,
6 | "metadata": {},
7 | "outputs": [],
8 | "source": []
9 | }
10 | ],
11 | "metadata": {
12 | "kernelspec": {
13 | "display_name": "Python 3 (ipykernel)",
14 | "language": "python",
15 | "name": "python3"
16 | },
17 | "language_info": {
18 | "codemirror_mode": {
19 | "name": "ipython",
20 | "version": 3
21 | },
22 | "file_extension": ".py",
23 | "mimetype": "text/x-python",
24 | "name": "python",
25 | "nbconvert_exporter": "python",
26 | "pygments_lexer": "ipython3",
27 | "version": "3.10.5"
28 | }
29 | },
30 | "nbformat": 4,
31 | "nbformat_minor": 4
32 | }
33 |
--------------------------------------------------------------------------------
/String and Arrays.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# *Strings and Arrays* "
8 | ]
9 | },
10 | {
11 | "cell_type": "markdown",
12 | "metadata": {},
13 | "source": [
14 | "# Two Sum II - Input array is sorted\n",
15 | "Given an array of integers numbers that is already sorted in non-decreasing order, find two numbers \n",
16 | "such that they add up to a specific target number.\n",
17 | "\n",
18 | "Return the indices of the two numbers (1-indexed) as an integer array answer of size 2, \n",
19 | "where 1 <= answer[0] < answer[1] <= numbers.length.\n",
20 | "\n",
21 | "The tests are generated such that there is exactly one solution. You may not use the same element twice.\n",
22 | "\n",
23 | "_Example 1:_
\n",
24 | "Input: numbers = [2,7,11,15], target = 9
\n",
25 | "Output: [1,2]
\n",
26 | "Explanation: The sum of 2 and 7 is 9. Therefore index1 = 1, index2 = 2.
\n",
27 | "\n",
28 | "_Example 2:_
\n",
29 | "Input: numbers = [2,3,4], target = 6
\n",
30 | "Output: [1,3]
\n",
31 | "\n",
32 | "_Example 3:_
\n",
33 | "Input: numbers = [-1,0], target = -1
\n",
34 | "Output: [1,2]
\n",
35 | " \n",
36 | "Constraints:\n",
37 | "* 2 <= numbers.length <= 3 * 10^4\n",
38 | "* -1000 <= numbers[i] <= 1000\n",
39 | "* numbers is sorted in non-decreasing order.\n",
40 | "* -1000 <= target <= 1000\n",
41 | "The tests are generated such that there is exactly one solution.\n"
42 | ]
43 | },
44 | {
45 | "cell_type": "code",
46 | "execution_count": 11,
47 | "metadata": {},
48 | "outputs": [
49 | {
50 | "name": "stdout",
51 | "output_type": "stream",
52 | "text": [
53 | "[4, 8]\n"
54 | ]
55 | }
56 | ],
57 | "source": [
58 | "def twoSum(numbers, target):\n",
59 | " num_len = len(numbers)\n",
60 | " i, j = 0, num_len-1\n",
61 | " sum_ = 0\n",
62 | " \n",
63 | " while i < j:\n",
64 | " sum_ = numbers[i] + numbers[j]\n",
65 | " if sum_ > target:\n",
66 | " j -= 1\n",
67 | " elif sum_ < target:\n",
68 | " i += 1\n",
69 | " else:\n",
70 | " return [i+1, j+1]\n",
71 | "\n",
72 | "#using two pointer technique\n",
73 | "lst = [0, 0 , 0, 5, 5, 6, 9, 9, 18, 27]\n",
74 | "trg = 14\n",
75 | "print(twoSum(lst, trg))"
76 | ]
77 | },
78 | {
79 | "cell_type": "markdown",
80 | "metadata": {},
81 | "source": [
82 | "# Remove element\n",
83 | "Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative \n",
84 | "order of the elements may be changed.\n",
85 | "\n",
86 | "Since it is impossible to change the length of the array in some languages, you must instead have the result \n",
87 | "be placed in the first part of the array nums. More formally, if there are k elements after removing the \n",
88 | "duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave \n",
89 | "beyond the first k elements.\n",
90 | "\n",
91 | "Return k after placing the final result in the first k slots of nums.\n",
92 | "\n",
93 | "Do not allocate extra space for another array. You must do this by modifying the input array in-place with \n",
94 | "O(1) extra memory.\n",
95 | "\n",
96 | "_Example 1:_
\n",
97 | "Input: nums = `[3,2,2,3]`, val = 3
\n",
98 | "Output: 2, nums = `[2,2,_,_]`
\n",
99 | "Explanation: Your function should return k = 2, with the first two elements of nums being 2.
\n",
100 | "It does not matter what you leave beyond the returned k (hence they are underscores).
\n",
101 | "\n",
102 | "_Example 2:_
\n",
103 | "Input: nums = `[0,1,2,2,3,0,4,2]`, val = 2
\n",
104 | "Output: 5, nums = `[0,1,4,0,3,_,_,_]`
\n",
105 | "Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, \n",
106 | "and 4.
\n",
107 | "\n",
108 | "Note that the five elements can be returned in any order.
\n",
109 | "It does not matter what you leave beyond the returned k (hence they are underscores)."
110 | ]
111 | },
112 | {
113 | "cell_type": "code",
114 | "execution_count": 14,
115 | "metadata": {},
116 | "outputs": [
117 | {
118 | "name": "stdout",
119 | "output_type": "stream",
120 | "text": [
121 | "5\n"
122 | ]
123 | }
124 | ],
125 | "source": [
126 | "def removeElement(nums, val):\n",
127 | " nums_len = len(nums)\n",
128 | " k = 0\n",
129 | " \n",
130 | " for i in range(nums_len):\n",
131 | " if nums[i] != val:\n",
132 | " nums[k] = nums[i]\n",
133 | " k += 1\n",
134 | " return k\n",
135 | "\n",
136 | "# using two pointer technique\n",
137 | "nums = [0,1,2,2,3,0,4,2]\n",
138 | "val = 2\n",
139 | "print(removeElement(nums, val))"
140 | ]
141 | },
142 | {
143 | "cell_type": "markdown",
144 | "metadata": {},
145 | "source": [
146 | "# Max consecutive ones\n",
147 | "Given a binary array nums, return the maximum number of consecutive 1's in the array.\n",
148 | "\n",
149 | "_Example 1:_
\n",
150 | "Input: nums = `[1,1,0,1,1,1]`
\n",
151 | "Output: 3
\n",
152 | "Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of \n",
153 | "consecutive 1s is 3.\n",
154 | "\n",
155 | "_Example 2:_
\n",
156 | "Input: nums = `[1,0,1,1,0,1]`
\n",
157 | "Output: 2 \n",
158 | " \n",
159 | "_Constraints:_\n",
160 | "* 1 <= nums.length <= 10^5
\n",
161 | "* nums[i] is either 0 or 1."
162 | ]
163 | },
164 | {
165 | "cell_type": "code",
166 | "execution_count": 4,
167 | "metadata": {},
168 | "outputs": [
169 | {
170 | "name": "stdout",
171 | "output_type": "stream",
172 | "text": [
173 | "5\n"
174 | ]
175 | }
176 | ],
177 | "source": [
178 | "class Solution(object):\n",
179 | " def findMaxConsecutiveOnes(self, nums):\n",
180 | " \"\"\"\n",
181 | " :type nums: List[int]\n",
182 | " :rtype: int\n",
183 | " \"\"\"\n",
184 | " one_count_max = 0\n",
185 | " one_c = 0\n",
186 | " \n",
187 | " for n in nums:\n",
188 | " if n:\n",
189 | " one_c += 1\n",
190 | " \n",
191 | " else :\n",
192 | " if one_c > one_count_max:\n",
193 | " one_count_max = one_c\n",
194 | " one_c = 0\n",
195 | " \n",
196 | " if one_c > one_count_max:\n",
197 | " one_count_max = one_c\n",
198 | " \n",
199 | " return one_count_max\n",
200 | " \n",
201 | " \n",
202 | "#main\n",
203 | "nums = [0,1,1,0,0,1,1,1,1,1,0]\n",
204 | "print(Solution.findMaxConsecutiveOnes(Solution, nums))"
205 | ]
206 | },
207 | {
208 | "cell_type": "markdown",
209 | "metadata": {},
210 | "source": [
211 | "# Minimum Size Subarray Sum\n",
212 | "Given an array of positive integers nums and a positive integer target, return the minimal length of a contiguous subarray [numsl, numsl+1, ..., numsr-1, numsr] of which the sum is greater than or equal to target. If there is no such subarray, return 0 instead.\n",
213 | "\n",
214 | "_Example 1:_
\n",
215 | "Input: `target = 7, nums = [2,3,1,2,4,3]`
\n",
216 | "Output: 2
\n",
217 | "Explanation: The subarray [4,3] has the minimal length under the problem constraint.\n",
218 | "\n",
219 | "_Example 2:_
\n",
220 | "Input: `target = 4, nums = [1,4,4]`
\n",
221 | "Output: 1\n",
222 | "\n",
223 | "_Example 3:_
\n",
224 | "Input: `target = 11, nums = [1,1,1,1,1,1,1,1]`
\n",
225 | "Output: 0\n",
226 | " \n",
227 | "_Constraints:_\n",
228 | "* 1 <= target <= 10^9 \n",
229 | "* 1 <= nums.length <= 10^5\n",
230 | "* 1 <= nums[i] <= 10^5\n",
231 | " \n",
232 | "Follow up: If you have figured out the O(n) solution, try coding another solution of which the time complexity is O(n log(n))."
233 | ]
234 | },
235 | {
236 | "cell_type": "code",
237 | "execution_count": 1,
238 | "metadata": {},
239 | "outputs": [
240 | {
241 | "name": "stdout",
242 | "output_type": "stream",
243 | "text": [
244 | "2\n"
245 | ]
246 | }
247 | ],
248 | "source": [
249 | "\"\"\"\n",
250 | "We could easily find the sum in O(1) time by storing the cumulative sum from the beginning(Memoization). \n",
251 | "After we have stored the cumulative sum in sums, we could easily find the sum of any subarray \n",
252 | "from i to j.\n",
253 | "\"\"\"\n",
254 | "def minSubArrayLenON2(target, nums):\n",
255 | " len_ = len(nums)\n",
256 | " sums = []\n",
257 | " min_sub_seq = len_ + 999\n",
258 | " \n",
259 | " for ele in nums: # this is memoization\n",
260 | " if len(sums):\n",
261 | " sums.append(sums[-1] + ele)\n",
262 | " else:\n",
263 | " sums.append(nums[0])\n",
264 | " \n",
265 | " for i in range(0, len_):\n",
266 | " for j in range(i, len_):\n",
267 | " if (sums[j] - sums[i] + nums[i]) >= target:\n",
268 | " min_sub_seq = min(min_sub_seq, j - i + 1)\n",
269 | " break\n",
270 | " return min_sub_seq if min_sub_seq != len_ + 999 else 0\n",
271 | " # Time complexity of O(n^2) : in Python it's going to exceed\n",
272 | "\n",
273 | "\n",
274 | "# main\n",
275 | "target = 8\n",
276 | "nums = [1, 4, 4]\n",
277 | "print(minSubArrayLenON2(target, nums))\n"
278 | ]
279 | },
280 | {
281 | "cell_type": "code",
282 | "execution_count": 5,
283 | "metadata": {},
284 | "outputs": [
285 | {
286 | "name": "stdout",
287 | "output_type": "stream",
288 | "text": [
289 | "2\n"
290 | ]
291 | }
292 | ],
293 | "source": [
294 | "\"\"\"\n",
295 | "Time complexity: O(n). \n",
296 | "Single iteration of O(n).\n",
297 | "Each element can be visited atmost twice, once by the right pointer(i) and (atmost)once by the left pointer.\n",
298 | "Space complexity: O(1) extra space. \n",
299 | "\"\"\"\n",
300 | "def minSubArrayLenON(target, nums):\n",
301 | " len_ = len(nums)\n",
302 | " result = len_ + 999\n",
303 | " left = 0\n",
304 | " var_sum = 0\n",
305 | " #this is also a two pointer technique concept\n",
306 | " for i in range(len_):\n",
307 | " var_sum += nums[i]\n",
308 | " \n",
309 | " while var_sum >= target:\n",
310 | " result = min(result, i - left + 1)\n",
311 | " var_sum -= nums[left]\n",
312 | " left += 1\n",
313 | " \n",
314 | " return result if result != len_ + 999 else 0\n",
315 | "\n",
316 | "\n",
317 | "# main\n",
318 | "target = 7\n",
319 | "nums = [2,3,1,2,4,3]\n",
320 | "print(minSubArrayLenON(target, nums)) "
321 | ]
322 | },
323 | {
324 | "cell_type": "markdown",
325 | "metadata": {},
326 | "source": [
327 | "# Palindrome Number\n",
328 | "Given an integer x, return true if x is palindrome integer.\n",
329 | "An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.\n",
330 | "\n",
331 | "_Example 1:_
\n",
332 | "Input: x = 121
\n",
333 | "Output: true
\n",
334 | "\n",
335 | "_Example 2:_
\n",
336 | "Input: x = -121
\n",
337 | "Output: false
\n",
338 | "Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.\n",
339 | "\n",
340 | "_Example 3:_
\n",
341 | "Input: x = 10
\n",
342 | "Output: false
\n",
343 | "Explanation: Reads 01 from right to left. Therefore it is not a palindrome.\n",
344 | "\n",
345 | "_Example 4:_
\n",
346 | "Input: x = -101
\n",
347 | "Output: false
\n",
348 | " \n",
349 | "_Constraints:_
\n",
350 | "$-2^{31} <= x <= 2^{31} - 1$\n"
351 | ]
352 | },
353 | {
354 | "cell_type": "code",
355 | "execution_count": 6,
356 | "metadata": {},
357 | "outputs": [
358 | {
359 | "name": "stdout",
360 | "output_type": "stream",
361 | "text": [
362 | "True\n"
363 | ]
364 | }
365 | ],
366 | "source": [
367 | "def isPalindrome(x):\n",
368 | " if not x: # as 0 is a palindrome number\n",
369 | " return True\n",
370 | " elif x % 10 == 0 or x < 0: # 10 gives 01 which is not palindrome\n",
371 | " return False\n",
372 | " \n",
373 | " rev = 0\n",
374 | " num = x\n",
375 | " rem = 0\n",
376 | " while num > 0:\n",
377 | " rem = num % 10\n",
378 | " rev = rev * 10 + rem\n",
379 | " num //= 10\n",
380 | " return rev == x\n",
381 | "\n",
382 | "\n",
383 | "# main\n",
384 | "x = 101\n",
385 | "print(isPalindrome(x))"
386 | ]
387 | },
388 | {
389 | "cell_type": "markdown",
390 | "metadata": {},
391 | "source": [
392 | "# Rotate Array\n",
393 | "Given an array, rotate the array to the right by k steps, where k is non-negative.\n",
394 | "\n",
395 | "_Example 1:_
\n",
396 | "Input: `nums = [1,2,3,4,5,6,7], k = 3`
\n",
397 | "Output: `[5,6,7,1,2,3,4]`
\n",
398 | "Explanation:
\n",
399 | "rotate 1 steps to the right: `[7,1,2,3,4,5,6]`
\n",
400 | "rotate 2 steps to the right: `[6,7,1,2,3,4,5]`
\n",
401 | "rotate 3 steps to the right: `[5,6,7,1,2,3,4]`
\n",
402 | "\n",
403 | "_Example 2:_
\n",
404 | "Input: `nums = [-1,-100,3,99], k = 2`
\n",
405 | "Output: `[3,99,-1,-100]`
\n",
406 | "Explanation:
\n",
407 | "rotate 1 steps to the right: `[99,-1,-100,3]`
\n",
408 | "rotate 2 steps to the right: `[3,99,-1,-100]`
\n",
409 | " \n",
410 | "_Constraint:_\n",
411 | "* $1 <= nums.length <= 10^5$\n",
412 | "* $-2^{31} <= nums[i] <= 2^{31} - 1$\n",
413 | "* $0 <= k <= 10^5$\n",
414 | " \n",
415 | "_Follow up:_
\n",
416 | "Try to come up with as many solutions as you can. There are at least three different ways to solve this problem.
\n",
417 | "Could you do it in-place with O(1) extra space?"
418 | ]
419 | },
420 | {
421 | "cell_type": "code",
422 | "execution_count": 26,
423 | "metadata": {},
424 | "outputs": [
425 | {
426 | "name": "stdout",
427 | "output_type": "stream",
428 | "text": [
429 | "k -> 2 [4, 5, 1, 2, 3]\n"
430 | ]
431 | }
432 | ],
433 | "source": [
434 | "def rotateNotInplace(nums, k):\n",
435 | " \"\"\"\n",
436 | " :type nums: List[int]\n",
437 | " :type k: int\n",
438 | " \"\"\"\n",
439 | " len_ = len(nums)\n",
440 | " k = k % len_\n",
441 | " if not k:\n",
442 | " return nums\n",
443 | " return nums[-k:] + nums[0:len_-k]\n",
444 | "\n",
445 | " \n",
446 | "def rotate(nums, k):\n",
447 | " \"\"\"\n",
448 | " :type nums: List[int]\n",
449 | " :type k: int\n",
450 | " :rtype: None Do not return anything, modify nums in-place instead.\n",
451 | " \"\"\"\n",
452 | " len_ = len(nums)\n",
453 | " k = k % len_\n",
454 | " if not k:\n",
455 | " return nums\n",
456 | " temp = nums[-k:] + nums[0:len_-k]\n",
457 | " for i in range(len_):\n",
458 | " nums[i] = temp[i]\n",
459 | " #but this is not so effective we're using extra memory\n",
460 | " \n",
461 | " \n",
462 | "\n",
463 | "#main\n",
464 | "nums = [1,2,3,4,5]\n",
465 | "k = 2\n",
466 | "rotate(nums, k)\n",
467 | "print('k ->', k, nums)"
468 | ]
469 | },
470 | {
471 | "cell_type": "markdown",
472 | "metadata": {},
473 | "source": [
474 | "# Pascal Triangle\n",
475 | "Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.\n",
476 | "\n",
477 | "_Example 1:_
\n",
478 | "Input: rowIndex = 3
\n",
479 | "Output: [1,3,3,1]
\n",
480 | "\n",
481 | "_Example 2:_
\n",
482 | "Input: rowIndex = 0
\n",
483 | "Output: [1]
\n",
484 | "\n",
485 | "_Example 3:_
\n",
486 | "Input: rowIndex = 1
\n",
487 | "Output: [1,1]
\n",
488 | " \n",
489 | "_Constraints:_
\n",
490 | "0 <= rowIndex <= 33
\n",
491 | " \n",
492 | "Follow up: Could you optimize your algorithm to use only O(rowIndex) extra space?"
493 | ]
494 | },
495 | {
496 | "cell_type": "code",
497 | "execution_count": 65,
498 | "metadata": {},
499 | "outputs": [
500 | {
501 | "name": "stdout",
502 | "output_type": "stream",
503 | "text": [
504 | "[1, 3, 3, 1]\n"
505 | ]
506 | }
507 | ],
508 | "source": [
509 | "def getRow(rowIndex):\n",
510 | " \"\"\"\n",
511 | " :type rowIndex: int\n",
512 | " :rtype: List[int]\n",
513 | " \"\"\"\n",
514 | " pascal = [[1]]\n",
515 | " pascal += [[1, 1] for i in range(rowIndex)]\n",
516 | " \n",
517 | " for i in range(2, rowIndex+1):\n",
518 | " for j in range(len(pascal[i-1])-1):\n",
519 | " sum_ = pascal[i-1][j] + pascal[i-1][j+1]\n",
520 | " pascal[i].insert(1, sum_)\n",
521 | " return pascal[rowIndex]\n",
522 | "\n",
523 | "\n",
524 | "#main\n",
525 | "print(getRow(3))"
526 | ]
527 | },
528 | {
529 | "cell_type": "markdown",
530 | "metadata": {},
531 | "source": [
532 | "# Reverse Words in a String III\n",
533 | "\n",
534 | "Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.\n",
535 | "\n",
536 | "_Example 1:_
\n",
537 | "Input: s = \"Let's take LeetCode contest\"
\n",
538 | "Output: \"s'teL ekat edoCteeL tsetnoc\"
\n",
539 | "\n",
540 | "_Example 2:_
\n",
541 | "Input: s = \"God Ding\"
\n",
542 | "Output: \"doG gniD\"
\n",
543 | " \n",
544 | "_Constraints:_\n",
545 | "* 1 <= s.length <= 5 * $10^4$\n",
546 | "* s contains printable ASCII characters.\n",
547 | "* s does not contain any leading or trailing spaces.\n",
548 | "* There is at least one word in s.\n",
549 | "* All the words in s are separated by a single space."
550 | ]
551 | },
552 | {
553 | "cell_type": "code",
554 | "execution_count": 13,
555 | "metadata": {},
556 | "outputs": [
557 | {
558 | "name": "stdout",
559 | "output_type": "stream",
560 | "text": [
561 | "ytinamuH si eht emerpuS pihskroW\n"
562 | ]
563 | }
564 | ],
565 | "source": [
566 | "def reverseWords(s):\n",
567 | " \"\"\"\n",
568 | " :type s: str\n",
569 | " :rtype: str\n",
570 | " \"\"\"\n",
571 | " lst = s.strip().split()\n",
572 | " for i in range(len(lst)):\n",
573 | " lst[i] = ''.join([lst[i][j] for j in range(len(lst[i])-1, -1, -1)])\n",
574 | " return ' '.join(lst)\n",
575 | " \n",
576 | " \n",
577 | " \n",
578 | "#main\n",
579 | "string = \"Humanity is the Supreme Workship\"\n",
580 | "print(reverseWords(string))"
581 | ]
582 | },
583 | {
584 | "cell_type": "markdown",
585 | "metadata": {},
586 | "source": [
587 | "# Remove Duplicates from Sorted Array\n",
588 | "Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.
\n",
589 | "\n",
590 | "Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements.
\n",
591 | "\n",
592 | "Return k after placing the final result in the first k slots of nums.
\n",
593 | "\n",
594 | "Do not allocate extra space for another array. You must do this by modifying the input array in-place with `O(1)` extra memory.
\n",
595 | "\n",
596 | "*Example 1:*
\n",
597 | "Input: nums = [1,1,2]
\n",
598 | "Output: 2, nums = [1,2,_]
\n",
599 | "Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.
\n",
600 | "It does not matter what you leave beyond the returned k (hence they are underscores).\n",
601 | "\n",
602 | "*Example 2:*
\n",
603 | "Input: nums = [0,0,1,1,1,2,2,3,3,4]
\n",
604 | "Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
\n",
605 | "Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.
\n",
606 | "It does not matter what you leave beyond the returned k (hence they are underscores).\n",
607 | " \n",
608 | "_Constraints:_\n",
609 | "* 0 <= nums.length <= 3 * 10^4 and \n",
610 | "* -100 <= nums[i] <= 100 and,\n",
611 | "* nums is sorted in non-decreasing order."
612 | ]
613 | },
614 | {
615 | "cell_type": "code",
616 | "execution_count": 5,
617 | "metadata": {},
618 | "outputs": [],
619 | "source": [
620 | "def removeDuplicates(nums):\n",
621 | " \"\"\"\n",
622 | " :type nums: List[int]\n",
623 | " :rtype: int\n",
624 | " \"\"\"\n",
625 | " len_ = len(nums)\n",
626 | " if not len_:\n",
627 | " return 0\n",
628 | " \n",
629 | " # Use the two pointer technique to remove the duplicates in-place.\n",
630 | " # The first element shouldn't be touched; it's already in its correct place.\n",
631 | " write_ptr = 1\n",
632 | " \n",
633 | " # Go through each element in the Array.\n",
634 | " for read_ptr in range(1, len_):\n",
635 | " # If the current element we're reading is different to the previous element\n",
636 | " if nums[read_ptr] != nums[read_ptr - 1]:\n",
637 | " nums[write_ptr] = nums[read_ptr]\n",
638 | " write_ptr += 1\n",
639 | " \n",
640 | " return write_ptr\n",
641 | " \n"
642 | ]
643 | },
644 | {
645 | "cell_type": "markdown",
646 | "metadata": {},
647 | "source": [
648 | "# Move zeroes\n",
649 | "Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non\n",
650 | "zero elements.
\n",
651 | "_Note that you must do this in-place without making a copy of the array._\n",
652 | "\n",
653 | "_Example 1:_
\n",
654 | "Input: nums = `[0,1,0,3,12]`
\n",
655 | "Output: `[1,3,12,0,0]`
\n",
656 | "\n",
657 | "_Example 2:_
\n",
658 | "Input: nums = `[0]`
\n",
659 | "Output: `[0]`
\n",
660 | " \n",
661 | "_Constraints:_\n",
662 | "* $ 1 <= nums.length <= 10^4 $\n",
663 | "* $ -2^{31}<= nums[i] <= 2^{31} - 1 $"
664 | ]
665 | },
666 | {
667 | "cell_type": "code",
668 | "execution_count": 12,
669 | "metadata": {},
670 | "outputs": [
671 | {
672 | "name": "stdout",
673 | "output_type": "stream",
674 | "text": [
675 | "[1, 2, 0, 0, 0, 0]\n"
676 | ]
677 | }
678 | ],
679 | "source": [
680 | "def moveZeroes(nums):\n",
681 | " \"\"\"\n",
682 | " :type nums: List[int]\n",
683 | " :rtype: None Do not return anything, modify nums in-place instead.\n",
684 | " \"\"\"\n",
685 | " count_zero = 0\n",
686 | " len_ = len(nums)\n",
687 | " i = 0\n",
688 | " \n",
689 | " while i < len_:\n",
690 | " if not nums[i]:\n",
691 | " nums.remove(0)\n",
692 | " count_zero += 1\n",
693 | " len_ -= 1\n",
694 | " i -= 1\n",
695 | " i += 1\n",
696 | "\n",
697 | " for z in range(count_zero):\n",
698 | " nums.append(0)\n",
699 | " return nums\n",
700 | "\n",
701 | " \n",
702 | "# main\n",
703 | "nums = [0, 0, 1, 0, 0, 2]\n",
704 | "print(moveZeroes(nums))"
705 | ]
706 | },
707 | {
708 | "cell_type": "markdown",
709 | "metadata": {},
710 | "source": [
711 | "## Strings and Arrays card completed, Hurrah !!!"
712 | ]
713 | }
714 | ],
715 | "metadata": {
716 | "kernelspec": {
717 | "display_name": "Python 3",
718 | "language": "python",
719 | "name": "python3"
720 | },
721 | "language_info": {
722 | "codemirror_mode": {
723 | "name": "ipython",
724 | "version": 3
725 | },
726 | "file_extension": ".py",
727 | "mimetype": "text/x-python",
728 | "name": "python",
729 | "nbconvert_exporter": "python",
730 | "pygments_lexer": "ipython3",
731 | "version": "3.8.10"
732 | }
733 | },
734 | "nbformat": 4,
735 | "nbformat_minor": 4
736 | }
737 |
--------------------------------------------------------------------------------
/Wings Core Tech_T3_Machine First And Intelligent Business Processes.md:
--------------------------------------------------------------------------------
1 | ## Statistics ##
2 | - Empirical Rule: most of the data lies within 3 std deviation of normal distribution data ie. 99.7%.
3 | - classical probability: like coin, card since we know all possible outcomes
4 | - empirical probability: based on historical data or experiment
5 | - subjective probability: works on belief
6 | - even odds: like coin flip
7 | - weighted odds: like weather forecast
8 | - permutation: order matters
9 | - combination: order not matters
10 | - percentile: 98th percentile means we lie in 2% topper
11 | - Percentile(x) = (Number of values fall under ‘x’/total number of values) × 100
12 | - probability tree used for conditional probablilty
13 | - dependent event: picking a two cards w/o replacement
14 | - independent event
15 | - Bayes Theorem
16 | - Random Variable (discrete or continuous)
17 | - Binomial
18 | - Bell shaped curve
19 | - z-score
20 | - Random Sample
21 | - Systematic Sample
22 | - Source of bias
23 | - Opportunity Sample
24 | - Stratified Sample
25 | - Cluster Sample
26 | - Central Limit Theorem: sample mean is approx to the population mean
27 | - Standard Error
28 | - Hypothesis Testing
29 | - ANOVA
30 | - t-test
31 | - goodness-of-fit test
32 |
33 |
34 |
35 | ## Python for Data Science Essential Training Part 1 ##
36 | - Pandas
37 | - Numpy
38 | + Matric multiplication using np.dot(mat1, mat2)
39 | - Matplotlib
40 | - Web Scraping using BeautifulSoup
41 | - Intro to NLP using nltk
42 | - Plotly interative visualization
43 |
44 |
45 | ## Python for Data Science Essential Training Part 2 ##
46 | - Machine Learning 101
47 | - Linear regression
48 | - Logistic regression
49 | - Clustering models: K-means and hierarchal models
50 | - Dimension reduction methods
51 | - Association rules
52 | - Ensembles methods
53 | - Introduction to neural networks
54 | - Decision tree models
55 | - scikit-learn
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/background/Reorder Linked List Sol.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/Reorder Linked List Sol.jpeg
--------------------------------------------------------------------------------
/background/deque.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/deque.png
--------------------------------------------------------------------------------
/background/generator.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/generator.gif
--------------------------------------------------------------------------------
/background/iterators-and-generators-in-python-4-1657095549.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/iterators-and-generators-in-python-4-1657095549.png
--------------------------------------------------------------------------------
/background/jupyter_format.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/jupyter_format.gif
--------------------------------------------------------------------------------
/background/kurtosis.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/kurtosis.webp
--------------------------------------------------------------------------------
/background/list_deque.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/list_deque.jpg
--------------------------------------------------------------------------------
/background/markdown.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/markdown.gif
--------------------------------------------------------------------------------
/background/matplotlib_anatomy.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/matplotlib_anatomy.gif
--------------------------------------------------------------------------------
/background/permu_comb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/permu_comb.png
--------------------------------------------------------------------------------
/background/stack_que.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/background/stack_que.png
--------------------------------------------------------------------------------
/datasets/Crypto Data.csv:
--------------------------------------------------------------------------------
1 | Rank,Currency_Name,Market_Capital,Price,Circulating_Supply,Volume(24h),Change(24h)
2 | 1,Bitcoin,60219183594.00,3631.72,16581450.00,1226800000.00,-0.0084
3 | 2,Ethereum,25061275598.00,264.44,94772198.00,462576000.00,0.0132
4 | 3,Bitcoin Cash,6815417939.00,410.47,16603775.00,260857000.00,-0.0322
5 | 4,Ripple,6646329833.00,0.17,38343841883.00,41945000.00,-0.0042
6 | 5,Dash,2607960913.00,344.36,7573378.00,97142300.00,0.0362
7 | 6,Litecoin,2562271606.00,48.30,53051957.00,212827000.00,0.0274
8 | 7,NEM,1880775000.00,0.21,8999999999.00,2941490.00,-0.0153
9 | 8,IOTA,1400024388.00,0.50,2779530283.00,9257370.00,0.0135
10 | 9,Monero,1318572158.00,87.29,15104906.00,28416400.00,0.0051
11 | 10,Ethereum Classic,980752344.00,10.24,95768179.00,33193100.00,-0.0023
12 | 11,NEO,953330000.00,19.07,50000000.00,22268200.00,0.1014
13 | 12,BitConnect,742161368.00,109.80,6759457.00,6876050.00,0.0024
14 | 13,Lisk,660697505.00,5.87,112588315.00,11626600.00,0.0826
15 | 14,Zcash,449832166.00,200.73,2240981.00,42222900.00,0.1284
16 | 15,Stratis,389138472.00,3.95,98553494.00,4242060.00,-0.0274
17 | 16,Waves,377436000.00,3.77,100000000.00,2874770.00,0.0265
18 | 17,Ark,273223160.00,2.80,97727338.00,3300420.00,-0.0087
19 | 18,Steem,244833707.00,1.01,242251308.00,585571.00,0.0143
20 | 19,Bytecoin,206169389.00,0.00,183253534612.00,990913.00,-0.0121
21 | 20,Decred,187452105.00,32.28,5806815.00,1564150.00,-0.0086
22 | 21,BitShares,181015326.00,0.07,2599260000.00,13569800.00,-0.025
23 | 22,Stellar Lumens,178986094.00,0.01,16587223471.00,1879370.00,-0.0069
24 | 23,Hshare,166544448.00,4.96,33600000.00,6192230.00,-0.0261
25 | 24,Komodo,164652221.00,1.63,100945510.00,721260.00,0.0099
26 | 25,PIVX,155221542.00,2.86,54342049.00,486072.00,0.0146
27 | 26,Factom,137200156.00,15.69,8745102.00,1497780.00,0.0369
28 | 27,Byteball Bytes,123838607.00,212.09,583896.00,148709.00,-0.0115
29 | 28,Nexus,114368857.00,2.17,52592813.00,1602630.00,-0.1895
30 | 29,Siacoin,114053002.00,0.00,29555679372.00,2142570.00,-0.0291
31 | 30,DigiByte,109587646.00,0.01,8742253657.00,1957170.00,-0.0115
32 | 31,BitcoinDark,105257379.00,81.67,1288862.00,254990.00,0.0329
33 | 32,GameCredits,95689716.00,1.49,64254060.00,624470.00,-0.0427
34 | 33,GXShares,88573495.00,2.19,40510000.00,9092.00,0.1078
35 | 34,Lykke,86893637.00,0.32,268135619.00,93098.00,0.0171
36 | 35,Dogecoin,84305613.00,0.00,111186000000.00,3480610.00,-0.0029
37 | 36,Blocknet,83012539.00,19.65,4224449.00,185903.00,-0.0371
38 | 37,Syscoin,75311596.00,0.14,527680360.00,1073870.00,-0.013
39 | 38,Verge,71456664.00,0.01,13409472280.00,1688240.00,-0.0309
40 | 39,FirstCoin,62294317.00,7.17,8682958.00,955802.00,0.0314
41 | 40,Nxt,58863274.00,0.06,998999942.00,2557440.00,-0.0072
42 | 41,I-O Coin,55776049.00,3.41,16367556.00,479574.00,-0.0604
43 | 42,Ubiq,53128777.00,1.40,38006679.00,603228.00,-0.0292
44 | 43,Particl,53125035.00,6.89,7712615.00,166934.00,-0.0044
45 | 44,NAV Coin,50847062.00,0.82,61803005.00,707893.00,0.0672
46 | 45,Rise,49052971.00,0.43,113139200.00,1312090.00,0.0081
47 | 46,Vertcoin,42079535.00,1.06,39682700.00,6746940.00,-0.1213
48 | 47,Bitdeal,38448620.00,0.32,119876595.00,311092.00,-0.0839
49 | 48,FairCoin,38238279.00,0.72,53193831.00,69622.00,0.036
50 | 49,Metaverse ETP,38149930.00,1.69,22600000.00,2638610.00,0.1397
51 | 50,Gulden,38129124.00,0.11,353145545.00,104792.00,-0.0058
52 | 51,ZCoin,36413644.00,11.94,3050102.00,7212140.00,0.1227
53 | 52,CloakCoin,33893251.00,6.64,5100672.00,478291.00,0.0714
54 | 53,NoLimitCoin,33711614.00,0.17,203672173.00,50887.00,-0.0147
55 | 54,Elastic,33182138.00,0.38,86652367.00,535066.00,-0.0073
56 | 55,Peercoin,31185065.00,1.28,24349826.00,239680.00,0.0406
57 | 56,Aidos Kuneen,29522780.00,3.32,8900500.00,19187.00,-0.0074
58 | 57,ReddCoin,26976964.00,0.00,28621316118.00,2616170.00,0.0334
59 | 58,LEOcoin,26585531.00,0.29,90555726.00,207026.00,-0.0747
60 | 59,Counterparty,25010000.00,9.55,2617796.00,118666.00,0.0152
61 | 60,MonaCoin,24507300.00,0.45,54118875.00,52056.00,-0.0083
62 | 61,DECENT,24255415.00,0.47,51306089.00,220511.00,-0.0187
63 | 62,The ChampCoin,23288007.00,0.14,164925727.00,128438.00,-0.0104
64 | 63,Viacoin,23186663.00,1.02,22832080.00,856231.00,-0.1161
65 | 64,Emercoin,22686762.00,0.56,40779545.00,134722.00,-0.0216
66 | 65,Crown,21689002.00,1.41,15337130.00,123920.00,-0.1231
67 | 66,Sprouts,20620960.00,0.00,584582141215.00,9854.00,0.7752
68 | 67,ION,20409426.00,1.24,16400095.00,33412.00,0.01
69 | 68,Namecoin,20299538.00,1.38,14736400.00,137457.00,0.1074
70 | 69,Clams,19830748.00,7.54,2628337.00,851718.00,0.0826
71 | 70,BitBay,19727228.00,0.02,1007740618.00,85094.00,-0.0069
72 | 71,OKCash,18962711.00,0.26,72634863.00,2215460.00,-0.1411
73 | 72,Unobtanium,18496843.00,93.50,197817.00,29635.00,-0.0127
74 | 73,Diamond,17492702.00,7.18,2434895.00,57368.00,0.016
75 | 74,Skycoin,17427322.00,2.97,5874530.00,7940.00,-0.026
76 | 75,MonetaryUnit,17369018.00,0.13,129486188.00,161942.00,0.0248
77 | 76,SpreadCoin,17360473.00,1.97,8795591.00,197955.00,-0.0352
78 | 77,Mooncoin,17069057.00,0.00,222291552483.00,4460.00,0.6474
79 | 78,Expanse,16496380.00,2.09,7906397.00,243444.00,-0.0465
80 | 79,SIBCoin,15517334.00,1.00,15484198.00,156351.00,0.0223
81 | 80,ZenCash,15231092.00,6.96,2188325.00,577949.00,0.0437
82 | 81,PotCoin,14722522.00,0.07,218038116.00,158127.00,-0.0617
83 | 82,Radium,14261301.00,4.26,3351177.00,139192.00,-0.0278
84 | 83,Burst,14199244.00,0.01,1800339818.00,335516.00,0.0039
85 | 84,LBRY Credits,14115161.00,0.21,68524524.00,756065.00,-0.0742
86 | 85,Shift,13822484.00,1.23,11214997.00,97938.00,-0.0105
87 | 86,DigitalNote,13657846.00,0.00,6885695758.00,2157890.00,-0.0497
88 | 87,Neblio,13553362.00,1.09,12399127.00,99456.00,0.1341
89 | 88,Einsteinium,13232583.00,0.06,214096252.00,2892490.00,0.0689
90 | 89,Compcoin,12984520.00,3.05,4264028.00,219424.00,0.2386
91 | 90,Omni,12799006.00,22.86,559786.00,41528.00,-0.0084
92 | 91,ATC Coin,12751674.00,1.21,10525960.00,498063.00,-0.007
93 | 92,Energycoin,12526103.00,0.10,121243039.00,20940.00,0.0011
94 | 93,Rubycoin,12519449.00,0.50,24792314.00,45798.00,-0.0788
95 | 94,Gambit,12437419.00,10.42,1193530.00,114899.00,0.0029
96 | 95,E-coin,12348031.00,3.08,4008919.00,69387.00,-0.0189
97 | 96,SaluS,12276886.00,12.23,1004195.00,51408.00,-0.0408
98 | 97,Groestlcoin,12211006.00,0.18,68438903.00,1205620.00,-0.0453
99 | 98,BlackCoin,12208321.00,0.16,76386509.00,324479.00,-0.0181
100 | 99,Golos,11820678.00,0.09,124518891.00,12482.00,-0.0569
101 | 100,GridCoin,11816250.00,0.03,390312753.00,276327.00,-0.052
102 |
--------------------------------------------------------------------------------
/datasets/Data - Multiple Worksheets.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/datasets/Data - Multiple Worksheets.xlsx
--------------------------------------------------------------------------------
/datasets/Data - Single Worksheet.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/datasets/Data - Single Worksheet.xlsx
--------------------------------------------------------------------------------
/datasets/Restaurant - Foods.csv:
--------------------------------------------------------------------------------
1 | Food ID,Food Item,Price
2 | 1,Sushi,3.99
3 | 2,Burrito,9.99
4 | 3,Taco,2.99
5 | 4,Quesadilla,4.25
6 | 5,Pizza,2.49
7 | 6,Pasta,13.99
8 | 7,Steak,24.99
9 | 8,Salad,11.25
10 | 9,Donut,0.99
11 | 10,Drink,1.75
--------------------------------------------------------------------------------
/datasets/Restaurant - Week 1 Sales.csv:
--------------------------------------------------------------------------------
1 | Customer ID,Food ID
2 | 537,9
3 | 97,4
4 | 658,1
5 | 202,2
6 | 155,9
7 | 213,8
8 | 600,1
9 | 503,5
10 | 71,3
11 | 174,3
12 | 961,9
13 | 966,5
14 | 641,4
15 | 288,2
16 | 149,4
17 | 954,2
18 | 147,9
19 | 155,1
20 | 550,6
21 | 101,7
22 | 549,6
23 | 75,6
24 | 78,7
25 | 514,5
26 | 833,7
27 | 329,8
28 | 586,10
29 | 341,1
30 | 519,10
31 | 680,9
32 | 419,7
33 | 20,1
34 | 822,6
35 | 226,10
36 | 203,2
37 | 77,1
38 | 628,4
39 | 296,9
40 | 821,9
41 | 697,8
42 | 264,7
43 | 477,9
44 | 524,4
45 | 121,3
46 | 290,7
47 | 100,1
48 | 260,6
49 | 798,9
50 | 462,3
51 | 896,7
52 | 953,1
53 | 682,10
54 | 809,7
55 | 450,10
56 | 772,7
57 | 304,3
58 | 159,6
59 | 189,4
60 | 876,2
61 | 864,8
62 | 799,8
63 | 68,6
64 | 812,8
65 | 30,2
66 | 921,2
67 | 941,6
68 | 108,3
69 | 315,4
70 | 358,10
71 | 249,9
72 | 491,9
73 | 110,8
74 | 737,3
75 | 836,6
76 | 749,9
77 | 758,8
78 | 527,3
79 | 677,10
80 | 741,3
81 | 540,3
82 | 433,7
83 | 250,10
84 | 504,1
85 | 819,4
86 | 910,7
87 | 351,10
88 | 282,7
89 | 117,5
90 | 937,10
91 | 63,6
92 | 144,2
93 | 393,7
94 | 380,7
95 | 515,7
96 | 233,3
97 | 357,3
98 | 3,2
99 | 875,2
100 | 352,6
101 | 93,3
102 | 323,1
103 | 21,4
104 | 64,10
105 | 912,10
106 | 327,6
107 | 399,2
108 | 459,6
109 | 418,7
110 | 669,3
111 | 259,9
112 | 816,7
113 | 761,9
114 | 410,7
115 | 304,2
116 | 772,10
117 | 80,2
118 | 363,9
119 | 504,5
120 | 728,6
121 | 71,8
122 | 479,6
123 | 922,1
124 | 244,2
125 | 319,9
126 | 909,1
127 | 919,10
128 | 51,2
129 | 26,9
130 | 472,8
131 | 77,9
132 | 608,6
133 | 160,5
134 | 645,8
135 | 574,10
136 | 374,4
137 | 100,7
138 | 762,8
139 | 45,7
140 | 332,7
141 | 338,10
142 | 140,8
143 | 567,2
144 | 602,1
145 | 10,2
146 | 77,2
147 | 74,1
148 | 1000,2
149 | 529,7
150 | 881,5
151 | 673,7
152 | 107,2
153 | 876,8
154 | 703,1
155 | 225,10
156 | 962,1
157 | 114,5
158 | 250,7
159 | 346,4
160 | 191,2
161 | 331,2
162 | 310,2
163 | 738,9
164 | 427,7
165 | 331,5
166 | 902,6
167 | 867,9
168 | 385,5
169 | 555,9
170 | 67,7
171 | 138,4
172 | 775,5
173 | 833,3
174 | 648,5
175 | 475,10
176 | 483,6
177 | 968,1
178 | 203,3
179 | 313,9
180 | 263,8
181 | 871,5
182 | 747,5
183 | 38,4
184 | 190,9
185 | 348,6
186 | 226,3
187 | 167,9
188 | 671,8
189 | 190,1
190 | 909,4
191 | 501,6
192 | 406,2
193 | 47,8
194 | 482,3
195 | 163,1
196 | 991,2
197 | 539,6
198 | 53,2
199 | 51,10
200 | 348,9
201 | 321,1
202 | 493,9
203 | 650,9
204 | 310,1
205 | 848,6
206 | 307,9
207 | 798,1
208 | 606,7
209 | 100,4
210 | 783,6
211 | 985,5
212 | 123,6
213 | 809,10
214 | 21,4
215 | 764,9
216 | 92,1
217 | 386,6
218 | 331,3
219 | 62,5
220 | 91,8
221 | 368,6
222 | 147,8
223 | 745,4
224 | 184,3
225 | 828,8
226 | 578,5
227 | 491,4
228 | 62,4
229 | 77,9
230 | 506,9
231 | 271,9
232 | 584,10
233 | 148,5
234 | 595,3
235 | 274,10
236 | 646,1
237 | 520,8
238 | 644,8
239 | 725,8
240 | 934,4
241 | 151,10
242 | 945,5
243 | 343,3
244 | 380,9
245 | 911,4
246 | 621,9
247 | 413,9
248 | 926,6
249 | 134,3
250 | 396,6
251 | 535,10
252 |
--------------------------------------------------------------------------------
/datasets/Restaurant - Week 1 Satisfaction.csv:
--------------------------------------------------------------------------------
1 | Satisfaction Rating
2 | 2
3 | 7
4 | 3
5 | 7
6 | 10
7 | 3
8 | 2
9 | 5
10 | 10
11 | 7
12 | 7
13 | 5
14 | 3
15 | 2
16 | 7
17 | 4
18 | 6
19 | 1
20 | 5
21 | 5
22 | 3
23 | 2
24 | 3
25 | 10
26 | 4
27 | 9
28 | 1
29 | 4
30 | 4
31 | 9
32 | 8
33 | 9
34 | 7
35 | 1
36 | 1
37 | 3
38 | 3
39 | 4
40 | 3
41 | 9
42 | 9
43 | 8
44 | 8
45 | 2
46 | 3
47 | 10
48 | 3
49 | 8
50 | 6
51 | 9
52 | 9
53 | 3
54 | 4
55 | 8
56 | 8
57 | 4
58 | 10
59 | 4
60 | 10
61 | 9
62 | 10
63 | 6
64 | 6
65 | 5
66 | 5
67 | 9
68 | 9
69 | 1
70 | 9
71 | 6
72 | 8
73 | 1
74 | 8
75 | 8
76 | 1
77 | 8
78 | 1
79 | 6
80 | 2
81 | 8
82 | 2
83 | 2
84 | 3
85 | 8
86 | 4
87 | 3
88 | 5
89 | 1
90 | 1
91 | 5
92 | 3
93 | 8
94 | 9
95 | 2
96 | 6
97 | 5
98 | 7
99 | 4
100 | 6
101 | 4
102 | 7
103 | 1
104 | 2
105 | 3
106 | 1
107 | 9
108 | 8
109 | 2
110 | 5
111 | 7
112 | 10
113 | 6
114 | 7
115 | 1
116 | 7
117 | 1
118 | 4
119 | 9
120 | 2
121 | 7
122 | 5
123 | 4
124 | 7
125 | 4
126 | 1
127 | 7
128 | 4
129 | 1
130 | 5
131 | 4
132 | 1
133 | 9
134 | 5
135 | 6
136 | 2
137 | 2
138 | 1
139 | 5
140 | 9
141 | 6
142 | 8
143 | 3
144 | 7
145 | 10
146 | 3
147 | 1
148 | 1
149 | 5
150 | 7
151 | 1
152 | 6
153 | 10
154 | 6
155 | 4
156 | 8
157 | 5
158 | 4
159 | 1
160 | 4
161 | 3
162 | 7
163 | 5
164 | 9
165 | 1
166 | 5
167 | 7
168 | 3
169 | 8
170 | 6
171 | 10
172 | 4
173 | 5
174 | 1
175 | 3
176 | 1
177 | 6
178 | 2
179 | 4
180 | 8
181 | 8
182 | 9
183 | 10
184 | 10
185 | 10
186 | 6
187 | 10
188 | 4
189 | 6
190 | 2
191 | 3
192 | 2
193 | 3
194 | 10
195 | 8
196 | 5
197 | 1
198 | 9
199 | 4
200 | 5
201 | 4
202 | 1
203 | 9
204 | 8
205 | 9
206 | 8
207 | 6
208 | 6
209 | 5
210 | 9
211 | 3
212 | 5
213 | 4
214 | 5
215 | 1
216 | 10
217 | 6
218 | 3
219 | 5
220 | 7
221 | 10
222 | 3
223 | 8
224 | 4
225 | 2
226 | 5
227 | 2
228 | 6
229 | 4
230 | 9
231 | 2
232 | 4
233 | 8
234 | 4
235 | 2
236 | 9
237 | 4
238 | 6
239 | 6
240 | 7
241 | 10
242 | 8
243 | 1
244 | 2
245 | 8
246 | 2
247 | 1
248 | 2
249 | 8
250 | 10
251 | 3
--------------------------------------------------------------------------------
/datasets/Restaurant - Week 2 Sales.csv:
--------------------------------------------------------------------------------
1 | Customer ID,Food ID
2 | 688,10
3 | 813,7
4 | 495,10
5 | 189,5
6 | 267,3
7 | 310,5
8 | 761,2
9 | 443,5
10 | 729,9
11 | 741,8
12 | 847,6
13 | 156,10
14 | 550,7
15 | 620,10
16 | 272,4
17 | 511,2
18 | 8,6
19 | 534,7
20 | 909,6
21 | 732,9
22 | 372,4
23 | 713,1
24 | 496,3
25 | 381,9
26 | 13,2
27 | 101,4
28 | 325,7
29 | 674,2
30 | 564,8
31 | 578,5
32 | 21,4
33 | 755,7
34 | 509,7
35 | 639,2
36 | 170,2
37 | 668,3
38 | 321,3
39 | 629,2
40 | 767,6
41 | 799,7
42 | 253,8
43 | 473,1
44 | 537,5
45 | 343,5
46 | 761,3
47 | 922,1
48 | 780,6
49 | 198,10
50 | 937,10
51 | 479,3
52 | 706,7
53 | 281,6
54 | 726,7
55 | 343,2
56 | 277,3
57 | 969,3
58 | 543,4
59 | 275,8
60 | 787,7
61 | 424,4
62 | 612,6
63 | 379,9
64 | 647,1
65 | 942,3
66 | 528,10
67 | 673,4
68 | 853,3
69 | 111,3
70 | 736,8
71 | 503,8
72 | 445,6
73 | 580,10
74 | 670,6
75 | 359,6
76 | 132,8
77 | 819,5
78 | 829,6
79 | 928,10
80 | 592,5
81 | 163,10
82 | 694,7
83 | 98,5
84 | 791,2
85 | 398,5
86 | 709,4
87 | 56,3
88 | 397,1
89 | 239,6
90 | 304,3
91 | 893,3
92 | 581,1
93 | 693,3
94 | 827,4
95 | 815,6
96 | 574,9
97 | 752,10
98 | 596,8
99 | 489,9
100 | 792,4
101 | 861,1
102 | 303,9
103 | 548,9
104 | 517,2
105 | 784,6
106 | 621,6
107 | 529,10
108 | 204,10
109 | 136,1
110 | 994,2
111 | 186,3
112 | 253,7
113 | 859,7
114 | 496,8
115 | 423,2
116 | 211,4
117 | 884,7
118 | 81,10
119 | 437,10
120 | 526,1
121 | 951,5
122 | 508,4
123 | 236,5
124 | 127,1
125 | 198,7
126 | 877,10
127 | 816,2
128 | 666,9
129 | 415,5
130 | 24,8
131 | 720,1
132 | 240,2
133 | 919,8
134 | 459,1
135 | 938,10
136 | 46,6
137 | 458,9
138 | 630,6
139 | 75,4
140 | 287,5
141 | 927,4
142 | 522,8
143 | 805,8
144 | 365,6
145 | 257,1
146 | 957,10
147 | 692,4
148 | 547,10
149 | 798,5
150 | 913,2
151 | 35,8
152 | 968,4
153 | 222,10
154 | 122,2
155 | 73,8
156 | 653,9
157 | 937,2
158 | 171,2
159 | 193,2
160 | 668,9
161 | 996,10
162 | 222,10
163 | 70,2
164 | 77,7
165 | 743,8
166 | 589,4
167 | 867,10
168 | 831,4
169 | 905,1
170 | 977,7
171 | 746,10
172 | 922,2
173 | 866,9
174 | 746,10
175 | 495,6
176 | 486,6
177 | 55,9
178 | 312,2
179 | 604,3
180 | 122,10
181 | 936,9
182 | 503,9
183 | 628,7
184 | 55,4
185 | 858,5
186 | 175,6
187 | 530,7
188 | 850,10
189 | 681,10
190 | 750,6
191 | 578,5
192 | 287,8
193 | 39,10
194 | 458,3
195 | 30,4
196 | 827,10
197 | 462,8
198 | 361,6
199 | 27,4
200 | 234,1
201 | 570,8
202 | 751,2
203 | 463,10
204 | 253,5
205 | 633,1
206 | 622,9
207 | 959,4
208 | 810,2
209 | 80,4
210 | 155,3
211 | 488,2
212 | 482,1
213 | 495,2
214 | 188,8
215 | 861,5
216 | 305,2
217 | 869,7
218 | 131,1
219 | 520,7
220 | 208,4
221 | 145,5
222 | 495,2
223 | 794,6
224 | 734,10
225 | 540,3
226 | 735,2
227 | 940,8
228 | 571,7
229 | 888,2
230 | 664,6
231 | 343,7
232 | 143,4
233 | 505,3
234 | 54,8
235 | 959,2
236 | 367,8
237 | 883,8
238 | 251,9
239 | 855,4
240 | 233,3
241 | 559,10
242 | 734,1
243 | 677,3
244 | 276,4
245 | 45,8
246 | 945,4
247 | 783,10
248 | 556,10
249 | 547,9
250 | 252,9
251 | 249,6
252 |
--------------------------------------------------------------------------------
/datasets/SleepStudyData.csv:
--------------------------------------------------------------------------------
1 | Enough,Hours,PhoneReach,PhoneTime,Tired,Breakfast
2 | Yes,8,Yes,Yes,3,Yes
3 | No,6,Yes,Yes,3,No
4 | Yes,6,Yes,Yes,2,Yes
5 | No,7,Yes,Yes,4,No
6 | No,7,Yes,Yes,2,Yes
7 | No,7,Yes,Yes,4,No
8 | Yes,7,Yes,Yes,3,Yes
9 | No,7,Yes,Yes,3,Yes
10 | No,4,No,Yes,2,Yes
11 | No,6,Yes,Yes,3,Yes
12 | No,10,Yes,Yes,4,No
13 | No,7,Yes,Yes,2,Yes
14 | Yes,7,Yes,Yes,3,No
15 | Yes,8,Yes,Yes,2,No
16 | Yes,7,No,Yes,3,Yes
17 | Yes,8,Yes,Yes,3,No
18 | Yes,6,Yes,Yes,4,Yes
19 | Yes,8,Yes,Yes,3,Yes
20 | No,9,Yes,Yes,3,Yes
21 | Yes,8,Yes,Yes,3,No
22 | No,2,Yes,Yes,5,No
23 | No,4,Yes,Yes,2,Yes
24 | No,5,Yes,No,3,Yes
25 | No,7,Yes,No,3,Yes
26 | No,5,Yes,Yes,2,No
27 | No,7,No,Yes,5,No
28 | No,6,Yes,Yes,3,No
29 | No,6,Yes,Yes,2,No
30 | Yes,7,Yes,No,2,Yes
31 | Yes,9,No,No,2,Yes
32 | Yes,8,Yes,Yes,2,Yes
33 | No,8,No,Yes,3,Yes
34 | No,6,Yes,Yes,4,No
35 | No,6,No,No,3,No
36 | No,7,No,Yes,3,Yes
37 | No,7,Yes,Yes,3,Yes
38 | Yes,7,No,No,2,Yes
39 | Yes,9,No,Yes,2,Yes
40 | No,5,Yes,No,5,No
41 | No,7,Yes,Yes,2,No
42 | Yes,8,No,Yes,1,Yes
43 | No,7,No,Yes,4,Yes
44 | No,5,Yes,Yes,3,No
45 | No,6,Yes,Yes,3,Yes
46 | No,4,No,No,5,No
47 | No,7,Yes,Yes,4,No
48 | Yes,9,Yes,Yes,1,Yes
49 | No,5,No,No,5,Yes
50 | No,6,No,Yes,3,Yes
51 | No,4,Yes,Yes,2,Yes
52 | No,5,Yes,No,3,No
53 | No,8,Yes,Yes,3,Yes
54 | No,7,No,Yes,4,Yes
55 | No,5,Yes,Yes,2,No
56 | No,7,Yes,Yes,3,Yes
57 | No,5,No,Yes,2,Yes
58 | No,6,Yes,Yes,3,No
59 | No,9,No,Yes,5,No
60 | No,9,Yes,No,4,Yes
61 | Yes,7,Yes,Yes,2,No
62 | No,6,Yes,Yes,3,No
63 | No,7,Yes,Yes,3,Yes
64 | No,2,No,No,5,No
65 | No,8,Yes,Yes,5,No
66 | No,7,Yes,Yes,4,Yes
67 | No,,Yes,No,3,Yes
68 | Yes,7,Yes,No,1,No
69 | No,7,Yes,Yes,3,Yes
70 | Yes,7,Yes,No,3,No
71 | No,6,Yes,Yes,3,Yes
72 | Yes,6,No,Yes,4,Yes
73 | No,5,Yes,Yes,4,Yes
74 | No,5,Yes,Yes,4,No
75 | No,6,No,Yes,5,Yes
76 | Yes,7,Yes,Yes,4,Yes
77 | No,6,No,Yes,4,No
78 | No,8,Yes,Yes,4,Yes
79 | Yes,6,Yes,Yes,4,No
80 | No,6,Yes,Yes,3,Yes
81 | No,7,Yes,Yes,4,No
82 | Yes,6,Yes,Yes,3,No
83 | No,6,Yes,Yes,3,No
84 | No,5,No,No,4,No
85 | Yes,8,No,No,2,Yes
86 | Yes,8,No,Yes,1,Yes
87 | No,6,Yes,Yes,3,No
88 | No,9,No,Yes,5,Yes
89 | No,5,Yes,No,4,Yes
90 | No,6,Yes,No,2,Yes
91 | Yes,8,No,Yes,3,Yes
92 | No,7,No,Yes,4,Yes
93 | Yes,,No,Yes,2,Yes
94 | Yes,7,No,Yes,2,Yes
95 | Yes,9,No,No,2,Yes
96 | Yes,8,Yes,Yes,4,No
97 | Yes,7,No,Yes,2,Yes
98 | No,7,Yes,Yes,4,Yes
99 | Yes,7,Yes,Yes,2,No
100 | No,6,Yes,Yes,3,No
101 | No,7,Yes,Yes,2,Yes
102 | No,7,No,Yes,3,Yes
103 | Yes,8,Yes,Yes,3,Yes
104 | Yes,7,Yes,Yes,2,Yes
105 | Yes,6,Yes,Yes,3,Yes
--------------------------------------------------------------------------------
/datasets/bigmac.csv:
--------------------------------------------------------------------------------
1 | Date,Country,Price in US Dollars
2 | 1/2016,Argentina,2.39
3 | 1/2016,Australia,3.74
4 | 1/2016,Brazil,3.35
5 | 1/2016,Britain,4.22
6 | 1/2016,Canada,4.14
7 | 1/2016,Chile,2.94
8 | 1/2016,China,2.68
9 | 1/2016,Colombia,2.43
10 | 1/2016,Costa Rica,4.02
11 | 1/2016,Czech Republic,2.98
12 | 1/2016,Denmark,4.32
13 | 1/2016,Egypt,2.16
14 | 1/2016,Euro area,4.0
15 | 1/2016,Hong Kong,2.48
16 | 1/2016,Hungary,3.08
17 | 1/2016,India,1.9
18 | 1/2016,Indonesia,2.19
19 | 1/2016,Israel,4.29
20 | 1/2016,Japan,3.12
21 | 1/2016,Malaysia,1.82
22 | 1/2016,Mexico,2.81
23 | 1/2016,New Zealand,3.91
24 | 1/2016,Norway,5.21
25 | 1/2016,Pakistan,2.86
26 | 1/2016,Peru,2.93
27 | 1/2016,Philippines,2.79
28 | 1/2016,Poland,2.37
29 | 1/2016,Russia,1.53
30 | 1/2016,Saudi Arabia,3.2
31 | 1/2016,Singapore,3.27
32 | 1/2016,South Africa,1.77
33 | 1/2016,South Korea,3.59
34 | 1/2016,Sri Lanka,2.43
35 | 1/2016,Sweden,5.23
36 | 1/2016,Switzerland,6.44
37 | 1/2016,Taiwan,2.08
38 | 1/2016,Thailand,3.09
39 | 1/2016,Turkey,3.41
40 | 1/2016,UAE,3.54
41 | 1/2016,Ukraine,1.54
42 | 1/2016,United States,4.93
43 | 1/2016,Uruguay,3.74
44 | 1/2016,Venezuela,0.66
45 | 1/2016,Vietnam,2.67
46 | 1/2016,Austria,3.76
47 | 1/2016,Belgium,4.25
48 | 1/2016,Estonia,3.23
49 | 1/2016,Finland,4.41
50 | 1/2016,France,4.41
51 | 1/2016,Germany,3.86
52 | 1/2016,Greece,3.6
53 | 1/2016,Ireland,4.25
54 | 1/2016,Italy,4.3
55 | 1/2016,Netherlands,3.71
56 | 1/2016,Portugal,3.23
57 | 1/2016,Spain,3.76
58 | 7/2015,Argentina,3.07
59 | 7/2015,Australia,3.92
60 | 7/2015,Brazil,4.28
61 | 7/2015,Britain,4.51
62 | 7/2015,Canada,4.54
63 | 7/2015,Chile,3.27
64 | 7/2015,China,2.74
65 | 7/2015,Colombia,2.92
66 | 7/2015,Costa Rica,4.03
67 | 7/2015,Czech Republic,2.83
68 | 7/2015,Denmark,5.08
69 | 7/2015,Egypt,2.16
70 | 7/2015,Euro area,4.05
71 | 7/2015,Hong Kong,2.48
72 | 7/2015,Hungary,3.18
73 | 7/2015,India,1.83
74 | 7/2015,Indonesia,2.29
75 | 7/2015,Israel,4.63
76 | 7/2015,Japan,2.99
77 | 7/2015,Malaysia,2.01
78 | 7/2015,Mexico,3.11
79 | 7/2015,New Zealand,3.91
80 | 7/2015,Norway,5.65
81 | 7/2015,Pakistan,3.44
82 | 7/2015,Peru,3.14
83 | 7/2015,Philippines,3.61
84 | 7/2015,Poland,2.54
85 | 7/2015,Russia,1.88
86 | 7/2015,Saudi Arabia,3.2
87 | 7/2015,Singapore,3.44
88 | 7/2015,South Africa,2.09
89 | 7/2015,South Korea,3.76
90 | 7/2015,Sri Lanka,2.61
91 | 7/2015,Sweden,5.13
92 | 7/2015,Switzerland,6.82
93 | 7/2015,Taiwan,2.55
94 | 7/2015,Thailand,3.17
95 | 7/2015,Turkey,3.87
96 | 7/2015,UAE,3.54
97 | 7/2015,Ukraine,1.55
98 | 7/2015,United States,4.79
99 | 7/2015,Uruguay,4.13
100 | 7/2015,Venezuela,0.67
101 | 7/2015,Vietnam,2.75
102 | 7/2015,Austria,3.71
103 | 7/2015,Belgium,4.05
104 | 7/2015,Estonia,3.23
105 | 7/2015,Finland,4.49
106 | 7/2015,France,4.49
107 | 7/2015,Germany,3.93
108 | 7/2015,Greece,3.34
109 | 7/2015,Ireland,4.05
110 | 7/2015,Italy,4.38
111 | 7/2015,Netherlands,3.78
112 | 7/2015,Portugal,3.29
113 | 7/2015,Spain,4.0
114 | 1/2015,Argentina,3.25
115 | 1/2015,Australia,4.32
116 | 1/2015,Brazil,5.21
117 | 1/2015,Britain,4.37
118 | 1/2015,Canada,4.64
119 | 1/2015,Chile,3.35
120 | 1/2015,China,2.77
121 | 1/2015,Colombia,3.34
122 | 1/2015,Costa Rica,4.01
123 | 1/2015,Czech Republic,2.92
124 | 1/2015,Denmark,5.38
125 | 1/2015,Egypt,2.3
126 | 1/2015,Euro area,4.26
127 | 1/2015,Hong Kong,2.43
128 | 1/2015,Hungary,3.17
129 | 1/2015,India,1.89
130 | 1/2015,Indonesia,2.24
131 | 1/2015,Israel,4.45
132 | 1/2015,Japan,3.14
133 | 1/2015,Malaysia,2.11
134 | 1/2015,Mexico,3.35
135 | 1/2015,New Zealand,4.49
136 | 1/2015,Norway,6.3
137 | 1/2015,Pakistan,2.98
138 | 1/2015,Peru,3.32
139 | 1/2015,Philippines,3.67
140 | 1/2015,Poland,2.48
141 | 1/2015,Russia,1.36
142 | 1/2015,Saudi Arabia,2.93
143 | 1/2015,Singapore,3.53
144 | 1/2015,South Africa,2.22
145 | 1/2015,South Korea,3.78
146 | 1/2015,Sri Lanka,2.65
147 | 1/2015,Sweden,4.97
148 | 1/2015,Switzerland,7.54
149 | 1/2015,Taiwan,2.51
150 | 1/2015,Thailand,3.04
151 | 1/2015,Turkey,3.96
152 | 1/2015,UAE,3.54
153 | 1/2015,Ukraine,1.2
154 | 1/2015,United States,4.79
155 | 1/2015,Uruguay,4.63
156 | 1/2015,Venezuela,2.53
157 | 1/2015,Vietnam,2.81
158 | 1/2015,Austria,3.93
159 | 1/2015,Belgium,4.29
160 | 1/2015,Estonia,3.36
161 | 1/2015,Finland,4.75
162 | 1/2015,France,4.52
163 | 1/2015,Germany,4.25
164 | 1/2015,Greece,3.53
165 | 1/2015,Ireland,4.04
166 | 1/2015,Italy,4.46
167 | 1/2015,Netherlands,4.0
168 | 1/2015,Portugal,3.48
169 | 1/2015,Spain,4.23
170 | 7/2014,Argentina,2.57
171 | 7/2014,Australia,4.81
172 | 7/2014,Brazil,5.86
173 | 7/2014,Britain,4.93
174 | 7/2014,Canada,5.25
175 | 7/2014,Chile,3.72
176 | 7/2014,China,2.73
177 | 7/2014,Colombia,4.65
178 | 7/2014,Costa Rica,4.0
179 | 7/2014,Czech Republic,3.46
180 | 7/2014,Denmark,5.15
181 | 7/2014,Egypt,2.37
182 | 7/2014,Euro area,4.95
183 | 7/2014,Hong Kong,2.43
184 | 7/2014,Hungary,3.77
185 | 7/2014,India,1.75
186 | 7/2014,Indonesia,2.43
187 | 7/2014,Israel,5.13
188 | 7/2014,Japan,3.64
189 | 7/2014,Lithuania,3.49
190 | 7/2014,Malaysia,2.41
191 | 7/2014,Mexico,3.25
192 | 7/2014,New Zealand,4.94
193 | 7/2014,Norway,7.76
194 | 7/2014,Pakistan,3.04
195 | 7/2014,Peru,3.59
196 | 7/2014,Philippines,3.7
197 | 7/2014,Poland,3.0
198 | 7/2014,Russia,2.55
199 | 7/2014,Saudi Arabia,2.93
200 | 7/2014,Singapore,3.8
201 | 7/2014,South Africa,2.33
202 | 7/2014,South Korea,4.0
203 | 7/2014,Sri Lanka,2.69
204 | 7/2014,Sweden,5.95
205 | 7/2014,Switzerland,6.83
206 | 7/2014,Taiwan,2.63
207 | 7/2014,Thailand,3.12
208 | 7/2014,Turkey,4.42
209 | 7/2014,UAE,3.54
210 | 7/2014,Ukraine,1.63
211 | 7/2014,United States,4.8
212 | 7/2014,Uruguay,4.92
213 | 7/2014,Venezuela,6.82
214 | 7/2014,Vietnam,2.83
215 | 7/2014,Austria,4.56
216 | 7/2014,Belgium,4.98
217 | 7/2014,Estonia,3.9
218 | 7/2014,Finland,5.52
219 | 7/2014,France,5.25
220 | 7/2014,Germany,4.94
221 | 7/2014,Greece,4.11
222 | 7/2014,Ireland,4.7
223 | 7/2014,Italy,5.18
224 | 7/2014,Netherlands,4.64
225 | 7/2014,Portugal,4.04
226 | 7/2014,Spain,4.91
227 | 1/2014,Argentina,3.03
228 | 1/2014,Australia,4.47
229 | 1/2014,Brazil,5.25
230 | 1/2014,Britain,4.63
231 | 1/2014,Canada,5.01
232 | 1/2014,Chile,3.69
233 | 1/2014,China,2.74
234 | 1/2014,Colombia,4.34
235 | 1/2014,Costa Rica,4.28
236 | 1/2014,Czech Republic,3.47
237 | 1/2014,Denmark,5.18
238 | 1/2014,Egypt,2.43
239 | 1/2014,Euro area,4.96
240 | 1/2014,Hong Kong,2.32
241 | 1/2014,Hungary,3.85
242 | 1/2014,India,1.54
243 | 1/2014,Indonesia,2.3
244 | 1/2014,Israel,5.02
245 | 1/2014,Japan,2.97
246 | 1/2014,Lithuania,3.46
247 | 1/2014,Malaysia,2.23
248 | 1/2014,Mexico,2.78
249 | 1/2014,New Zealand,4.57
250 | 1/2014,Norway,7.8
251 | 1/2014,Pakistan,3.04
252 | 1/2014,Peru,3.56
253 | 1/2014,Philippines,2.98
254 | 1/2014,Poland,3.0
255 | 1/2014,Russia,2.62
256 | 1/2014,Saudi Arabia,2.93
257 | 1/2014,Singapore,3.6
258 | 1/2014,South Africa,2.16
259 | 1/2014,South Korea,3.47
260 | 1/2014,Sri Lanka,2.68
261 | 1/2014,Sweden,6.29
262 | 1/2014,Switzerland,7.14
263 | 1/2014,Taiwan,2.62
264 | 1/2014,Thailand,2.92
265 | 1/2014,Turkey,3.76
266 | 1/2014,UAE,3.27
267 | 1/2014,Ukraine,2.27
268 | 1/2014,United States,4.62
269 | 1/2014,Uruguay,4.91
270 | 1/2014,Venezuela,7.15
271 | 1/2014,Vietnam,2.84
272 | 1/2014,Austria,4.6
273 | 1/2014,Belgium,5.36
274 | 1/2014,Estonia,3.8
275 | 1/2014,Finland,5.56
276 | 1/2014,France,5.15
277 | 1/2014,Germany,4.98
278 | 1/2014,Greece,4.14
279 | 1/2014,Ireland,4.69
280 | 1/2014,Italy,5.22
281 | 1/2014,Netherlands,4.68
282 | 1/2014,Portugal,4.07
283 | 1/2014,Spain,4.95
284 | 7/2013,Argentina,3.88
285 | 7/2013,Australia,4.62
286 | 7/2013,Brazil,5.28
287 | 7/2013,Britain,4.02
288 | 7/2013,Canada,5.26
289 | 7/2013,Chile,3.94
290 | 7/2013,China,2.61
291 | 7/2013,Colombia,4.48
292 | 7/2013,Costa Rica,4.31
293 | 7/2013,Czech Republic,3.49
294 | 7/2013,Denmark,4.91
295 | 7/2013,Egypt,2.39
296 | 7/2013,Euro area,4.66
297 | 7/2013,Hong Kong,2.19
298 | 7/2013,Hungary,3.76
299 | 7/2013,India,1.5
300 | 7/2013,Indonesia,2.8
301 | 7/2013,Israel,4.8
302 | 7/2013,Japan,3.2
303 | 7/2013,Latvia,3.09
304 | 7/2013,Lithuania,3.2
305 | 7/2013,Malaysia,2.3
306 | 7/2013,Mexico,2.86
307 | 7/2013,New Zealand,4.3
308 | 7/2013,Norway,7.51
309 | 7/2013,Pakistan,3.0
310 | 7/2013,Peru,3.59
311 | 7/2013,Philippines,2.65
312 | 7/2013,Poland,2.73
313 | 7/2013,Russia,2.64
314 | 7/2013,Saudi Arabia,2.67
315 | 7/2013,Singapore,3.69
316 | 7/2013,South Africa,2.24
317 | 7/2013,South Korea,3.43
318 | 7/2013,Sri Lanka,2.83
319 | 7/2013,Sweden,6.16
320 | 7/2013,Switzerland,6.72
321 | 7/2013,Taiwan,2.63
322 | 7/2013,Thailand,2.85
323 | 7/2013,Turkey,4.34
324 | 7/2013,UAE,3.27
325 | 7/2013,Ukraine,2.33
326 | 7/2013,United States,4.56
327 | 7/2013,Uruguay,4.98
328 | 7/2013,Venezuela,7.15
329 | 7/2013,Austria,4.36
330 | 7/2013,Belgium,4.76
331 | 7/2013,Estonia,3.54
332 | 7/2013,Finland,5.27
333 | 7/2013,France,5.01
334 | 7/2013,Germany,4.68
335 | 7/2013,Greece,3.34
336 | 7/2013,Ireland,4.45
337 | 7/2013,Italy,4.82
338 | 7/2013,Netherlands,4.44
339 | 7/2013,Portugal,3.79
340 | 7/2013,Spain,4.5
341 | 1/2013,Argentina,3.82
342 | 1/2013,Australia,4.9
343 | 1/2013,Brazil,5.64
344 | 1/2013,Britain,4.25
345 | 1/2013,Canada,5.39
346 | 1/2013,Chile,4.35
347 | 1/2013,China,2.57
348 | 1/2013,Colombia,4.85
349 | 1/2013,Costa Rica,4.39
350 | 1/2013,Czech Republic,3.72
351 | 1/2013,Denmark,5.18
352 | 1/2013,Egypt,2.39
353 | 1/2013,Euro area,4.88
354 | 1/2013,Hong Kong,2.19
355 | 1/2013,Hungary,3.82
356 | 1/2013,India,1.67
357 | 1/2013,Indonesia,2.86
358 | 1/2013,Israel,4.0
359 | 1/2013,Japan,3.51
360 | 1/2013,Latvia,3.28
361 | 1/2013,Lithuania,3.07
362 | 1/2013,Malaysia,2.58
363 | 1/2013,Mexico,2.9
364 | 1/2013,New Zealand,4.32
365 | 1/2013,Norway,7.84
366 | 1/2013,Pakistan,2.97
367 | 1/2013,Peru,3.91
368 | 1/2013,Philippines,2.91
369 | 1/2013,Poland,2.94
370 | 1/2013,Russia,2.43
371 | 1/2013,Saudi Arabia,2.93
372 | 1/2013,Singapore,3.64
373 | 1/2013,South Africa,2.31
374 | 1/2013,South Korea,3.41
375 | 1/2013,Sri Lanka,2.77
376 | 1/2013,Sweden,6.39
377 | 1/2013,Switzerland,7.12
378 | 1/2013,Taiwan,2.54
379 | 1/2013,Thailand,2.92
380 | 1/2013,Turkey,4.78
381 | 1/2013,UAE,3.27
382 | 1/2013,Ukraine,2.33
383 | 1/2013,United States,4.37
384 | 1/2013,Uruguay,5.45
385 | 1/2013,Venezuela,9.08
386 | 1/2013,Austria,4.6
387 | 1/2013,Belgium,5.16
388 | 1/2013,Estonia,3.66
389 | 1/2013,Finland,5.09
390 | 1/2013,France,4.89
391 | 1/2013,Germany,4.94
392 | 1/2013,Greece,4.48
393 | 1/2013,Ireland,4.74
394 | 1/2013,Italy,5.22
395 | 1/2013,Netherlands,4.68
396 | 1/2013,Portugal,4.0
397 | 1/2013,Spain,4.75
398 | 7/2012,Argentina,4.16
399 | 7/2012,Australia,4.68
400 | 7/2012,Brazil,4.94
401 | 7/2012,Britain,4.16
402 | 7/2012,Canada,5.02
403 | 7/2012,Chile,4.16
404 | 7/2012,China,2.45
405 | 7/2012,Colombia,4.77
406 | 7/2012,Costa Rica,2.4
407 | 7/2012,Czech Republic,3.34
408 | 7/2012,Denmark,4.65
409 | 7/2012,Egypt,2.64
410 | 7/2012,Euro area,4.34
411 | 7/2012,Hong Kong,2.13
412 | 7/2012,Hungary,3.48
413 | 7/2012,India,1.58
414 | 7/2012,Indonesia,2.55
415 | 7/2012,Israel,2.92
416 | 7/2012,Japan,4.09
417 | 7/2012,Latvia,2.94
418 | 7/2012,Lithuania,2.74
419 | 7/2012,Malaysia,2.33
420 | 7/2012,Mexico,2.7
421 | 7/2012,New Zealand,4.0
422 | 7/2012,Norway,7.06
423 | 7/2012,Pakistan,3.01
424 | 7/2012,Philippines,2.8
425 | 7/2012,Poland,2.63
426 | 7/2012,Russia,2.29
427 | 7/2012,Saudi Arabia,2.67
428 | 7/2012,Singapore,3.5
429 | 7/2012,South Africa,2.36
430 | 7/2012,South Korea,3.21
431 | 7/2012,Sri Lanka,2.21
432 | 7/2012,Sweden,5.73
433 | 7/2012,Switzerland,6.56
434 | 7/2012,Taiwan,2.48
435 | 7/2012,Thailand,2.59
436 | 7/2012,Turkey,4.52
437 | 7/2012,UAE,3.27
438 | 7/2012,Ukraine,1.86
439 | 7/2012,United States,4.33
440 | 7/2012,Uruguay,4.53
441 | 7/2012,Venezuela,7.92
442 | 7/2012,Austria,3.87
443 | 7/2012,Belgium,4.61
444 | 7/2012,Estonia,2.47
445 | 7/2012,Finland,4.55
446 | 7/2012,France,4.36
447 | 7/2012,Germany,4.41
448 | 7/2012,Greece,3.25
449 | 7/2012,Ireland,4.23
450 | 7/2012,Italy,4.36
451 | 7/2012,Netherlands,4.1
452 | 7/2012,Portugal,6.0
453 | 7/2012,Spain,4.24
454 | 1/2012,Argentina,4.64
455 | 1/2012,Australia,4.94
456 | 1/2012,Brazil,5.68
457 | 1/2012,Britain,3.82
458 | 1/2012,Canada,4.63
459 | 1/2012,Chile,4.05
460 | 1/2012,China,2.44
461 | 1/2012,Colombia,4.54
462 | 1/2012,Costa Rica,4.02
463 | 1/2012,Czech Republic,3.45
464 | 1/2012,Denmark,5.37
465 | 1/2012,Egypt,2.57
466 | 1/2012,Euro area,4.43
467 | 1/2012,Hong Kong,2.12
468 | 1/2012,Hungary,2.63
469 | 1/2012,India,1.62
470 | 1/2012,Indonesia,2.46
471 | 1/2012,Israel,4.13
472 | 1/2012,Japan,4.16
473 | 1/2012,Latvia,3.0
474 | 1/2012,Lithuania,2.87
475 | 1/2012,Malaysia,2.34
476 | 1/2012,Mexico,2.7
477 | 1/2012,New Zealand,4.05
478 | 1/2012,Norway,6.79
479 | 1/2012,Pakistan,2.89
480 | 1/2012,Peru,3.71
481 | 1/2012,Philippines,2.68
482 | 1/2012,Poland,2.58
483 | 1/2012,Russia,2.55
484 | 1/2012,Saudi Arabia,2.67
485 | 1/2012,Singapore,3.75
486 | 1/2012,South Africa,2.45
487 | 1/2012,South Korea,3.19
488 | 1/2012,Sri Lanka,2.55
489 | 1/2012,Sweden,5.91
490 | 1/2012,Switzerland,6.81
491 | 1/2012,Taiwan,2.5
492 | 1/2012,Thailand,2.46
493 | 1/2012,Turkey,3.54
494 | 1/2012,UAE,3.27
495 | 1/2012,Ukraine,2.11
496 | 1/2012,United States,4.2
497 | 1/2012,Uruguay,4.63
498 | 1/2012,Venezuela,6.99
499 | 1/2012,Austria,3.92
500 | 1/2012,Belgium,4.69
501 | 1/2012,Estonia,2.59
502 | 1/2012,Finland,4.76
503 | 1/2012,France,4.57
504 | 1/2012,Germany,4.48
505 | 1/2012,Greece,4.19
506 | 1/2012,Ireland,4.82
507 | 1/2012,Italy,4.44
508 | 1/2012,Netherlands,4.12
509 | 1/2012,Portugal,3.68
510 | 1/2012,Spain,4.44
511 | 7/2011,Argentina,4.84
512 | 7/2011,Australia,4.94
513 | 7/2011,Brazil,6.16
514 | 7/2011,Britain,3.89
515 | 7/2011,Canada,5.0
516 | 7/2011,Chile,4.0
517 | 7/2011,China,2.27
518 | 7/2011,Colombia,4.74
519 | 7/2011,Costa Rica,4.07
520 | 7/2011,Czech Republic,4.07
521 | 7/2011,Denmark,5.48
522 | 7/2011,Egypt,2.36
523 | 7/2011,Euro area,4.93
524 | 7/2011,Hong Kong,1.94
525 | 7/2011,Hungary,4.04
526 | 7/2011,India,1.89
527 | 7/2011,Indonesia,2.64
528 | 7/2011,Israel,4.67
529 | 7/2011,Japan,4.08
530 | 7/2011,Latvia,3.23
531 | 7/2011,Lithuania,3.03
532 | 7/2011,Malaysia,2.42
533 | 7/2011,Mexico,2.74
534 | 7/2011,New Zealand,4.41
535 | 7/2011,Norway,8.31
536 | 7/2011,Pakistan,2.38
537 | 7/2011,Peru,3.65
538 | 7/2011,Philippines,2.78
539 | 7/2011,Poland,3.09
540 | 7/2011,Russia,2.7
541 | 7/2011,Saudi Arabia,2.67
542 | 7/2011,Singapore,3.65
543 | 7/2011,South Africa,2.87
544 | 7/2011,South Korea,3.5
545 | 7/2011,Sri Lanka,2.56
546 | 7/2011,Sweden,7.64
547 | 7/2011,Switzerland,8.06
548 | 7/2011,Taiwan,2.6
549 | 7/2011,Thailand,2.35
550 | 7/2011,Turkey,3.77
551 | 7/2011,UAE,3.27
552 | 7/2011,Ukraine,2.06
553 | 7/2011,United States,4.07
554 | 7/2011,Uruguay,4.88
555 | 7/2011,Venezuela,6.52
556 | 7/2011,Austria,4.43
557 | 7/2011,Belgium,5.38
558 | 7/2011,Estonia,3.15
559 | 7/2011,Finland,5.38
560 | 7/2011,France,5.02
561 | 7/2011,Germany,4.87
562 | 7/2011,Greece,4.67
563 | 7/2011,Ireland,5.45
564 | 7/2011,Italy,5.02
565 | 7/2011,Netherlands,4.66
566 | 7/2011,Portugal,4.16
567 | 7/2011,Spain,5.02
568 | 7/2010,Argentina,3.56
569 | 7/2010,Australia,3.84
570 | 7/2010,Brazil,4.91
571 | 7/2010,Britain,3.48
572 | 7/2010,Canada,4.0
573 | 7/2010,Chile,3.34
574 | 7/2010,China,1.95
575 | 7/2010,Colombia,4.39
576 | 7/2010,Costa Rica,3.83
577 | 7/2010,Czech Republic,3.43
578 | 7/2010,Denmark,4.9
579 | 7/2010,Egypt,2.28
580 | 7/2010,Euro area,4.33
581 | 7/2010,Hong Kong,1.9
582 | 7/2010,Hungary,3.33
583 | 7/2010,Indonesia,2.51
584 | 7/2010,Israel,3.86
585 | 7/2010,Japan,3.67
586 | 7/2010,Latvia,2.8
587 | 7/2010,Lithuania,2.71
588 | 7/2010,Malaysia,2.19
589 | 7/2010,Mexico,2.5
590 | 7/2010,New Zealand,3.59
591 | 7/2010,Norway,7.2
592 | 7/2010,Pakistan,2.46
593 | 7/2010,Peru,3.54
594 | 7/2010,Philippines,2.19
595 | 7/2010,Poland,2.6
596 | 7/2010,Russia,2.33
597 | 7/2010,Saudi Arabia,2.67
598 | 7/2010,Singapore,3.08
599 | 7/2010,South Africa,2.45
600 | 7/2010,South Korea,2.82
601 | 7/2010,Sri Lanka,1.86
602 | 7/2010,Sweden,6.56
603 | 7/2010,Switzerland,6.19
604 | 7/2010,Taiwan,2.34
605 | 7/2010,Thailand,2.17
606 | 7/2010,Turkey,3.89
607 | 7/2010,UAE,2.99
608 | 7/2010,Ukraine,1.84
609 | 7/2010,United States,3.73
610 | 7/2010,Uruguay,3.74
611 | 1/2010,Argentina,1.84
612 | 1/2010,Australia,3.98
613 | 1/2010,Brazil,4.76
614 | 1/2010,Britain,3.67
615 | 1/2010,Canada,3.97
616 | 1/2010,Chile,3.18
617 | 1/2010,China,1.83
618 | 1/2010,Colombia,3.91
619 | 1/2010,Costa Rica,3.52
620 | 1/2010,Czech Republic,3.71
621 | 1/2010,Denmark,5.99
622 | 1/2010,Egypt,2.38
623 | 1/2010,Euro area,4.84
624 | 1/2010,Hong Kong,1.91
625 | 1/2010,Hungary,3.86
626 | 1/2010,Indonesia,2.24
627 | 1/2010,Israel,3.99
628 | 1/2010,Japan,3.5
629 | 1/2010,Latvia,3.09
630 | 1/2010,Lithuania,2.87
631 | 1/2010,Malaysia,2.08
632 | 1/2010,Mexico,2.5
633 | 1/2010,New Zealand,3.61
634 | 1/2010,Norway,7.02
635 | 1/2010,Pakistan,2.42
636 | 1/2010,Peru,2.81
637 | 1/2010,Philippines,2.21
638 | 1/2010,Poland,2.86
639 | 1/2010,Russia,2.34
640 | 1/2010,Saudi Arabia,2.67
641 | 1/2010,Singapore,3.19
642 | 1/2010,South Africa,2.46
643 | 1/2010,South Korea,2.98
644 | 1/2010,Sri Lanka,1.83
645 | 1/2010,Sweden,5.51
646 | 1/2010,Switzerland,6.3
647 | 1/2010,Taiwan,2.36
648 | 1/2010,Thailand,2.11
649 | 1/2010,Turkey,3.83
650 | 1/2010,UAE,2.99
651 | 1/2010,Ukraine,1.83
652 | 1/2010,United States,3.58
653 | 1/2010,Uruguay,3.32
654 |
--------------------------------------------------------------------------------
/datasets/crops.csv:
--------------------------------------------------------------------------------
1 | Crops,Key
2 | apple,1
3 | banana,2
4 | blackgram,3
5 | chickpea,4
6 | coconut,5
7 | coffee,6
8 | cotton,7
9 | grapes,8
10 | jute,9
11 | kidneybeans,10
12 | lentil,11
13 | maize,12
14 | mango,13
15 | mothbeans,14
16 | mungbean,15
17 | muskmelon,16
18 | orange,17
19 | papaya,18
20 | pigeonpeas,19
21 | pomegranate,20
22 | rice,21
23 | watermelon,22
24 | NA,nan
--------------------------------------------------------------------------------
/datasets/ecommerce.csv:
--------------------------------------------------------------------------------
1 | ID,order_date,delivery_date
2 | 1,5/24/98,2/5/99
3 | 2,4/22/92,3/6/98
4 | 4,2/10/91,8/26/92
5 | 5,7/21/92,11/20/97
6 | 7,9/2/93,6/10/98
7 | 8,6/10/93,11/11/93
8 | 9,1/25/90,10/2/94
9 | 10,2/23/92,12/30/98
10 | 11,7/12/96,7/14/97
11 | 18,6/18/95,10/13/97
12 | 19,5/10/98,5/19/98
13 | 20,10/17/92,10/6/98
14 | 23,5/30/92,8/15/99
15 | 26,4/11/96,5/4/98
16 | 30,10/22/98,1/11/99
17 | 32,1/20/90,7/24/98
18 | 33,9/21/94,10/12/96
19 | 35,9/10/93,4/28/96
20 | 36,5/15/90,2/14/94
21 | 39,3/26/90,1/25/93
22 | 41,2/6/92,5/10/96
23 | 46,9/5/95,7/19/96
24 | 50,5/3/91,7/17/99
25 | 52,9/2/94,5/14/97
26 | 53,11/29/95,6/23/98
27 | 54,8/7/96,4/4/98
28 | 58,2/11/95,4/16/95
29 | 59,9/29/95,12/16/95
30 | 60,2/14/93,8/6/95
31 | 63,12/22/90,9/2/95
32 | 64,11/25/90,5/14/98
33 | 66,9/8/92,12/29/98
34 | 67,5/4/90,2/4/93
35 | 68,2/14/90,6/26/90
36 | 70,2/16/94,11/6/99
37 | 71,11/25/90,4/6/98
38 | 73,10/1/91,5/19/93
39 | 75,6/25/90,12/18/96
40 | 76,5/26/97,6/5/98
41 | 78,2/25/92,2/17/99
42 | 79,6/11/92,12/4/92
43 | 80,3/15/95,8/17/97
44 | 84,1/24/90,6/6/96
45 | 85,3/5/91,5/14/92
46 | 88,8/29/97,9/19/97
47 | 90,10/9/92,12/23/97
48 | 91,1/17/93,9/27/99
49 | 93,12/24/91,6/15/99
50 | 94,4/1/93,5/7/98
51 | 98,8/23/91,8/30/97
52 | 102,8/20/90,1/12/92
53 | 105,1/11/91,12/3/94
54 | 107,10/23/91,5/3/93
55 | 110,7/20/92,7/22/94
56 | 114,4/2/90,1/20/91
57 | 115,10/22/90,2/3/95
58 | 117,8/18/93,8/20/98
59 | 118,9/6/91,9/21/93
60 | 120,5/3/91,3/9/94
61 | 122,11/22/95,7/31/96
62 | 123,11/30/90,9/7/94
63 | 129,4/9/90,5/24/91
64 | 130,4/2/90,8/16/99
65 | 132,9/27/92,10/18/99
66 | 133,12/14/90,10/21/92
67 | 136,1/28/92,7/23/98
68 | 137,4/2/97,8/28/97
69 | 139,9/9/92,11/10/94
70 | 141,9/3/91,3/8/99
71 | 144,3/11/94,11/7/97
72 | 145,7/16/92,8/4/96
73 | 151,1/29/91,8/5/99
74 | 152,12/9/90,9/2/98
75 | 153,3/11/96,1/13/98
76 | 157,7/12/97,5/12/99
77 | 159,12/23/95,12/19/96
78 | 160,7/6/91,1/10/97
79 | 161,10/30/91,7/5/92
80 | 162,9/10/91,10/4/93
81 | 163,5/21/90,4/1/91
82 | 164,4/18/97,8/9/98
83 | 165,3/23/90,6/7/98
84 | 166,7/12/90,5/1/98
85 | 167,11/30/93,11/19/94
86 | 169,3/24/91,10/7/94
87 | 171,2/23/91,4/27/96
88 | 173,11/29/91,11/3/95
89 | 174,10/4/90,4/6/93
90 | 182,3/3/94,6/3/94
91 | 189,2/27/91,7/3/92
92 | 196,12/9/91,8/10/98
93 | 207,5/19/94,11/29/95
94 | 211,7/5/91,4/25/93
95 | 215,5/24/91,4/9/97
96 | 216,3/9/90,12/1/97
97 | 218,8/26/93,2/24/97
98 | 220,4/19/90,2/12/91
99 | 221,12/24/91,4/28/97
100 | 222,1/21/93,4/20/99
101 | 226,7/18/92,6/9/93
102 | 228,5/6/90,7/23/91
103 | 229,4/13/90,11/17/98
104 | 230,11/11/92,11/10/98
105 | 231,7/18/93,9/17/98
106 | 234,5/15/92,9/5/99
107 | 236,2/23/95,4/12/96
108 | 237,9/6/93,11/21/96
109 | 238,3/6/92,1/29/96
110 | 239,4/13/92,9/3/93
111 | 241,11/29/90,5/11/98
112 | 245,2/8/91,5/7/96
113 | 248,5/23/98,6/17/99
114 | 249,6/10/95,4/23/97
115 | 250,5/27/90,8/28/95
116 | 251,4/9/91,3/7/93
117 | 252,1/28/91,1/8/92
118 | 254,12/29/90,11/19/96
119 | 256,8/2/91,1/8/95
120 | 260,4/27/93,5/30/94
121 | 261,5/6/95,8/11/98
122 | 264,7/2/93,3/31/98
123 | 265,11/26/94,9/21/99
124 | 266,3/31/95,5/22/96
125 | 276,2/10/94,2/12/96
126 | 277,7/18/94,10/6/94
127 | 279,10/8/91,6/8/97
128 | 280,5/27/95,9/12/96
129 | 282,4/30/90,3/24/98
130 | 283,8/1/91,9/26/96
131 | 284,10/10/93,1/4/94
132 | 285,6/7/91,3/29/93
133 | 287,1/27/90,6/9/95
134 | 289,2/26/90,12/24/96
135 | 290,4/4/90,12/15/93
136 | 292,9/15/92,9/1/97
137 | 294,12/30/91,11/8/95
138 | 295,6/12/94,9/23/99
139 | 298,7/29/93,1/17/94
140 | 299,8/17/92,12/28/92
141 | 303,6/6/95,8/15/95
142 | 304,1/17/90,2/16/96
143 | 307,2/19/91,4/10/95
144 | 309,9/3/90,2/9/94
145 | 310,9/20/97,10/6/97
146 | 311,1/6/90,2/6/90
147 | 314,3/7/90,12/25/99
148 | 319,11/30/90,9/4/91
149 | 321,6/17/97,8/27/99
150 | 323,12/22/92,2/1/96
151 | 324,7/25/91,4/22/98
152 | 326,5/12/98,5/29/99
153 | 329,8/13/92,3/18/94
154 | 331,9/18/90,12/19/99
155 | 332,3/24/91,7/31/94
156 | 334,10/8/92,4/17/98
157 | 335,12/9/92,7/28/94
158 | 336,4/16/95,4/2/98
159 | 337,8/16/90,2/10/91
160 | 338,8/14/97,10/3/99
161 | 340,9/26/90,1/7/96
162 | 341,8/19/96,2/13/97
163 | 344,12/24/96,2/14/97
164 | 346,4/27/98,6/3/99
165 | 347,6/18/91,10/19/91
166 | 348,2/27/90,1/4/99
167 | 349,10/31/91,7/5/99
168 | 350,10/29/95,9/13/96
169 | 351,4/12/95,5/27/98
170 | 353,12/5/92,5/5/94
171 | 354,5/28/91,11/15/95
172 | 359,12/24/90,7/4/94
173 | 363,7/17/91,6/22/93
174 | 364,12/5/90,5/10/94
175 | 365,6/29/94,12/2/97
176 | 369,10/26/92,12/9/96
177 | 370,6/11/91,6/24/99
178 | 373,2/6/95,9/16/96
179 | 377,11/4/94,4/8/96
180 | 378,12/20/90,5/7/92
181 | 379,4/3/91,10/12/91
182 | 380,10/9/91,2/22/92
183 | 382,8/6/92,12/4/95
184 | 383,5/10/99,11/28/99
185 | 386,3/21/90,8/18/90
186 | 387,4/23/93,5/10/96
187 | 390,7/18/90,6/28/96
188 | 391,8/19/90,4/19/91
189 | 392,12/24/90,12/4/99
190 | 393,5/6/93,11/15/93
191 | 397,1/24/98,8/13/99
192 | 398,9/11/93,6/28/95
193 | 399,5/30/94,7/22/96
194 | 402,1/4/96,8/22/98
195 | 404,6/6/94,12/9/96
196 | 405,10/1/92,3/4/95
197 | 407,7/12/91,12/9/95
198 | 411,5/25/93,8/15/96
199 | 413,7/18/90,3/23/94
200 | 416,2/20/92,4/22/94
201 | 418,4/2/90,12/1/94
202 | 422,6/5/93,10/4/97
203 | 423,9/26/95,10/17/96
204 | 424,7/16/94,2/24/99
205 | 431,5/8/91,2/24/98
206 | 432,10/10/91,7/28/95
207 | 433,1/8/93,5/28/99
208 | 434,7/12/95,9/11/98
209 | 437,4/30/94,2/18/97
210 | 438,11/24/96,8/22/99
211 | 441,1/14/98,6/13/98
212 | 442,12/3/90,8/5/91
213 | 445,2/11/93,2/24/94
214 | 447,3/31/92,12/14/99
215 | 449,2/27/99,11/13/99
216 | 450,2/2/96,12/6/99
217 | 451,5/8/94,11/7/97
218 | 453,7/22/90,12/22/97
219 | 454,1/12/90,8/20/95
220 | 455,12/12/93,8/16/94
221 | 457,6/17/91,6/18/92
222 | 458,6/11/96,6/13/99
223 | 459,2/24/97,4/27/97
224 | 464,12/16/94,6/11/95
225 | 465,6/24/93,10/21/99
226 | 466,9/22/90,2/17/98
227 | 467,6/17/92,8/29/94
228 | 468,5/4/97,2/24/98
229 | 469,10/17/92,6/5/96
230 | 470,1/6/95,8/4/96
231 | 473,12/12/94,3/30/98
232 | 476,1/14/94,4/16/96
233 | 478,12/22/94,4/30/98
234 | 479,3/29/90,5/18/97
235 | 481,2/16/94,11/30/96
236 | 483,5/31/91,5/8/93
237 | 484,8/30/93,9/22/93
238 | 486,3/26/91,12/29/93
239 | 490,4/2/91,10/25/97
240 | 491,11/3/92,9/12/99
241 | 492,11/6/92,3/15/95
242 | 493,12/21/96,2/27/99
243 | 495,2/16/93,3/26/97
244 | 496,9/13/91,2/17/95
245 | 498,6/4/96,8/28/97
246 | 500,11/12/96,1/9/98
247 | 502,9/11/93,3/29/98
248 | 503,3/19/95,11/7/95
249 | 505,5/10/97,8/9/97
250 | 506,2/21/92,9/2/94
251 | 511,8/9/97,1/3/99
252 | 513,8/24/90,4/4/92
253 | 515,3/24/94,3/18/95
254 | 519,10/19/91,12/12/94
255 | 520,11/8/93,7/30/97
256 | 521,5/6/90,8/18/97
257 | 522,5/7/90,4/8/91
258 | 527,1/26/93,1/13/99
259 | 528,2/15/90,6/19/90
260 | 529,11/8/93,12/19/96
261 | 532,4/14/96,2/28/98
262 | 533,12/19/95,4/6/97
263 | 535,1/29/94,8/6/97
264 | 536,7/2/91,3/22/94
265 | 538,7/6/93,12/9/93
266 | 539,4/26/92,12/27/94
267 | 541,12/11/98,4/15/99
268 | 543,11/23/93,9/15/99
269 | 544,11/29/90,11/21/97
270 | 548,11/3/90,8/11/98
271 | 551,10/31/93,3/4/94
272 | 555,1/4/98,9/12/99
273 | 557,11/3/95,1/14/98
274 | 558,6/17/93,1/26/95
275 | 561,6/18/92,8/9/95
276 | 562,12/1/92,2/19/98
277 | 565,5/26/92,7/15/93
278 | 569,5/26/92,4/3/95
279 | 571,9/18/94,7/4/96
280 | 574,3/26/91,10/7/96
281 | 576,11/23/91,8/3/99
282 | 578,6/11/95,9/11/99
283 | 581,8/6/91,5/22/96
284 | 583,12/6/90,10/18/95
285 | 585,5/22/90,10/30/91
286 | 586,12/11/91,10/5/99
287 | 588,6/24/92,12/8/92
288 | 590,3/25/90,12/20/98
289 | 595,10/4/95,11/2/99
290 | 596,12/28/94,3/22/96
291 | 598,6/1/91,4/29/93
292 | 600,5/11/94,10/16/96
293 | 601,6/20/94,8/9/96
294 | 604,3/29/94,7/30/97
295 | 606,10/14/92,9/12/96
296 | 612,8/11/94,8/20/94
297 | 613,4/28/92,10/1/96
298 | 614,3/7/91,7/3/96
299 | 615,11/10/93,1/10/94
300 | 616,12/15/94,3/15/95
301 | 617,1/7/93,2/16/99
302 | 618,1/30/92,7/10/92
303 | 619,7/22/92,11/28/92
304 | 620,8/28/90,3/29/95
305 | 623,7/26/91,12/18/95
306 | 626,3/12/91,8/26/97
307 | 630,3/30/97,12/23/99
308 | 632,5/18/90,4/21/96
309 | 633,5/1/97,11/8/99
310 | 634,4/4/91,7/21/99
311 | 635,5/30/98,9/22/98
312 | 636,3/1/91,5/17/99
313 | 639,4/30/98,1/29/99
314 | 640,11/26/94,10/21/95
315 | 642,4/26/91,9/29/93
316 | 643,6/20/96,9/30/98
317 | 644,1/2/93,9/10/97
318 | 647,3/1/91,8/5/95
319 | 648,5/24/93,9/20/98
320 | 649,5/7/96,9/11/99
321 | 650,5/12/96,2/13/98
322 | 651,5/28/92,7/17/98
323 | 652,9/28/97,6/4/98
324 | 653,1/24/94,6/24/94
325 | 654,6/30/94,6/23/95
326 | 655,8/1/93,7/27/99
327 | 658,10/17/92,7/16/99
328 | 659,10/11/98,11/3/98
329 | 660,2/5/94,9/8/98
330 | 663,12/21/95,6/17/99
331 | 664,2/21/91,9/27/94
332 | 667,5/16/93,2/22/99
333 | 671,1/13/92,6/9/97
334 | 672,7/10/93,8/11/94
335 | 674,3/16/90,12/28/98
336 | 675,2/24/91,4/28/94
337 | 677,2/21/92,11/3/99
338 | 679,7/3/95,5/20/97
339 | 681,1/8/94,4/7/94
340 | 683,6/7/92,7/14/92
341 | 685,12/29/94,12/5/97
342 | 686,7/5/92,6/28/95
343 | 697,4/22/94,2/14/96
344 | 698,12/6/92,11/9/98
345 | 699,8/31/98,2/27/99
346 | 700,2/7/95,4/5/96
347 | 701,1/6/92,7/18/96
348 | 702,11/8/97,2/27/99
349 | 704,2/2/90,8/12/90
350 | 706,5/17/90,1/7/96
351 | 709,5/17/94,4/8/97
352 | 713,11/8/90,3/9/93
353 | 715,4/28/92,1/7/95
354 | 718,4/1/93,4/20/99
355 | 720,8/12/98,12/24/98
356 | 723,2/4/90,8/26/93
357 | 725,2/15/93,5/16/95
358 | 726,6/26/98,3/9/99
359 | 727,5/2/91,4/7/98
360 | 728,5/17/95,5/16/97
361 | 730,12/10/92,12/28/92
362 | 731,9/16/92,5/9/96
363 | 732,10/5/90,4/14/97
364 | 733,8/12/91,4/6/93
365 | 734,1/17/93,11/27/96
366 | 735,12/23/93,12/10/97
367 | 737,12/1/92,10/29/94
368 | 739,8/15/90,10/18/93
369 | 741,1/15/91,9/3/97
370 | 744,2/23/98,10/1/99
371 | 747,7/29/92,9/22/94
372 | 748,6/6/91,2/19/99
373 | 749,10/2/95,1/18/97
374 | 750,3/29/95,4/8/99
375 | 753,5/30/90,8/3/94
376 | 754,3/29/96,8/31/96
377 | 756,10/11/92,5/7/99
378 | 758,1/10/93,9/22/97
379 | 760,9/16/90,12/6/98
380 | 762,1/11/92,4/20/98
381 | 764,9/19/90,9/16/99
382 | 766,12/25/95,9/24/99
383 | 767,4/23/91,4/5/92
384 | 768,9/18/91,2/5/95
385 | 769,12/1/94,4/9/98
386 | 770,3/28/98,6/5/98
387 | 773,5/12/96,3/29/98
388 | 775,12/3/92,6/14/99
389 | 776,7/27/92,10/13/94
390 | 777,9/11/94,4/21/99
391 | 779,5/25/95,2/21/96
392 | 781,7/16/95,8/17/95
393 | 782,12/22/95,4/23/97
394 | 784,4/8/97,11/9/97
395 | 786,10/26/90,5/10/99
396 | 787,2/27/90,2/6/96
397 | 788,6/13/90,10/2/95
398 | 789,12/28/91,3/14/93
399 | 790,12/30/97,6/3/99
400 | 791,1/5/98,9/1/98
401 | 794,3/21/94,5/30/95
402 | 796,1/19/94,2/18/95
403 | 797,8/5/96,4/10/97
404 | 799,2/11/93,2/1/99
405 | 802,8/31/94,11/3/96
406 | 805,9/27/92,4/10/95
407 | 806,3/18/90,11/18/92
408 | 807,3/8/95,1/10/98
409 | 809,9/3/92,10/4/94
410 | 817,12/12/93,6/1/98
411 | 818,12/19/94,1/4/98
412 | 819,12/6/98,7/31/99
413 | 820,1/27/94,10/31/97
414 | 821,2/24/91,8/15/93
415 | 822,11/10/91,8/20/98
416 | 825,12/12/91,9/15/99
417 | 826,4/16/90,5/18/98
418 | 827,5/19/92,3/13/94
419 | 828,8/9/91,1/15/92
420 | 832,8/23/91,12/13/98
421 | 833,11/23/94,10/28/99
422 | 834,6/26/94,9/28/94
423 | 838,11/27/90,7/3/93
424 | 839,4/17/91,8/4/92
425 | 840,7/19/92,1/24/97
426 | 841,8/4/91,5/9/92
427 | 843,2/5/91,5/6/91
428 | 845,5/26/94,5/12/98
429 | 846,3/13/97,12/3/97
430 | 848,7/15/90,6/21/92
431 | 851,10/20/91,8/26/92
432 | 853,6/29/91,5/13/92
433 | 855,1/1/92,3/17/93
434 | 856,6/26/93,3/5/96
435 | 861,2/24/95,10/17/95
436 | 862,3/19/97,8/27/99
437 | 863,11/5/92,6/15/96
438 | 865,11/13/94,6/11/96
439 | 868,2/12/91,12/26/91
440 | 871,7/17/91,11/15/95
441 | 872,8/19/90,7/7/95
442 | 873,8/18/98,10/5/98
443 | 874,5/3/94,12/31/98
444 | 876,11/21/91,10/20/97
445 | 878,7/23/94,1/14/96
446 | 879,11/30/96,1/2/98
447 | 880,4/11/97,7/9/99
448 | 881,2/21/90,9/11/97
449 | 882,3/4/97,1/3/99
450 | 884,1/20/90,11/12/99
451 | 887,9/25/93,8/9/98
452 | 888,9/1/95,11/1/99
453 | 892,2/21/91,4/16/98
454 | 894,5/24/90,8/12/97
455 | 896,8/23/90,5/5/91
456 | 898,5/24/90,6/1/90
457 | 900,1/26/92,11/23/99
458 | 901,5/6/91,1/16/93
459 | 902,7/3/91,11/10/99
460 | 904,2/13/90,11/15/99
461 | 905,6/16/95,10/2/96
462 | 906,11/3/97,5/26/99
463 | 907,8/11/94,9/28/98
464 | 908,11/4/93,2/26/97
465 | 909,1/19/91,8/22/98
466 | 912,8/21/92,1/24/93
467 | 916,12/3/94,3/26/97
468 | 918,12/29/94,7/29/96
469 | 919,1/25/92,6/1/93
470 | 922,7/6/96,12/5/98
471 | 924,3/17/91,5/13/96
472 | 926,10/31/90,4/12/94
473 | 932,7/25/97,4/9/98
474 | 934,5/22/95,7/11/95
475 | 935,9/26/90,3/7/98
476 | 938,3/24/93,7/15/95
477 | 939,10/1/98,12/7/98
478 | 942,4/14/92,3/3/97
479 | 943,1/30/91,12/2/99
480 | 945,10/27/92,11/3/94
481 | 946,7/2/91,2/23/96
482 | 947,6/18/91,6/11/99
483 | 949,10/7/91,1/7/92
484 | 951,10/2/91,4/18/94
485 | 953,9/26/91,5/8/94
486 | 954,8/8/93,1/23/94
487 | 956,8/23/95,1/10/99
488 | 957,10/1/94,7/25/99
489 | 958,4/26/90,6/29/97
490 | 969,9/24/96,11/16/96
491 | 972,2/7/90,11/5/95
492 | 975,6/18/97,11/2/97
493 | 981,1/31/97,3/4/98
494 | 983,12/30/94,7/29/97
495 | 984,7/25/91,2/9/99
496 | 985,7/26/95,6/18/96
497 | 986,12/10/90,12/16/92
498 | 990,6/24/91,2/2/96
499 | 991,9/9/91,3/30/98
500 | 993,11/16/90,4/27/98
501 | 994,6/3/93,6/13/93
502 | 997,1/4/90,10/3/91
--------------------------------------------------------------------------------
/datasets/jamesbond.csv:
--------------------------------------------------------------------------------
1 | Film,Year,Actor,Director,Box Office,Budget,Bond Actor Salary
2 | Dr. No,1962,Sean Connery,Terence Young,448.8,7,0.6
3 | From Russia with Love,1963,Sean Connery,Terence Young,543.8,12.6,1.6
4 | Goldfinger,1964,Sean Connery,Guy Hamilton,820.4,18.6,3.2
5 | Thunderball,1965,Sean Connery,Terence Young,848.1,41.9,4.7
6 | Casino Royale,1967,David Niven,Ken Hughes,315,85,
7 | You Only Live Twice,1967,Sean Connery,Lewis Gilbert,514.2,59.9,4.4
8 | On Her Majesty's Secret Service,1969,George Lazenby,Peter R. Hunt,291.5,37.3,0.6
9 | Diamonds Are Forever,1971,Sean Connery,Guy Hamilton,442.5,34.7,5.8
10 | Live and Let Die,1973,Roger Moore,Guy Hamilton,460.3,30.8,
11 | The Man with the Golden Gun,1974,Roger Moore,Guy Hamilton,334,27.7,
12 | The Spy Who Loved Me,1977,Roger Moore,Lewis Gilbert,533,45.1,
13 | Moonraker,1979,Roger Moore,Lewis Gilbert,535,91.5,
14 | For Your Eyes Only,1981,Roger Moore,John Glen,449.4,60.2,
15 | Never Say Never Again,1983,Sean Connery,Irvin Kershner,380,86,
16 | Octopussy,1983,Roger Moore,John Glen,373.8,53.9,7.8
17 | A View to a Kill,1985,Roger Moore,John Glen,275.2,54.5,9.1
18 | The Living Daylights,1987,Timothy Dalton,John Glen,313.5,68.8,5.2
19 | Licence to Kill,1989,Timothy Dalton,John Glen,250.9,56.7,7.9
20 | GoldenEye,1995,Pierce Brosnan,Martin Campbell,518.5,76.9,5.1
21 | Tomorrow Never Dies,1997,Pierce Brosnan,Roger Spottiswoode,463.2,133.9,10
22 | The World Is Not Enough,1999,Pierce Brosnan,Michael Apted,439.5,158.3,13.5
23 | Die Another Day,2002,Pierce Brosnan,Lee Tamahori,465.4,154.2,17.9
24 | Casino Royale,2006,Daniel Craig,Martin Campbell,581.5,145.3,3.3
25 | Quantum of Solace,2008,Daniel Craig,Marc Forster,514.2,181.4,8.1
26 | Skyfall,2012,Daniel Craig,Sam Mendes,943.5,170.2,14.5
27 | Spectre,2015,Daniel Craig,Sam Mendes,726.7,206.3,
--------------------------------------------------------------------------------
/datasets/nba.csv:
--------------------------------------------------------------------------------
1 | Name,Team,Number,Position,Age,Height,Weight,College,Salary
2 | Avery Bradley,Boston Celtics,0.0,PG,25.0,6-2,180.0,Texas,7730337.0
3 | Jae Crowder,Boston Celtics,99.0,SF,25.0,6-6,235.0,Marquette,6796117.0
4 | John Holland,Boston Celtics,30.0,SG,27.0,6-5,205.0,Boston University,
5 | R.J. Hunter,Boston Celtics,28.0,SG,22.0,6-5,185.0,Georgia State,1148640.0
6 | Jonas Jerebko,Boston Celtics,8.0,PF,29.0,6-10,231.0,,5000000.0
7 | Amir Johnson,Boston Celtics,90.0,PF,29.0,6-9,240.0,,12000000.0
8 | Jordan Mickey,Boston Celtics,55.0,PF,21.0,6-8,235.0,LSU,1170960.0
9 | Kelly Olynyk,Boston Celtics,41.0,C,25.0,7-0,238.0,Gonzaga,2165160.0
10 | Terry Rozier,Boston Celtics,12.0,PG,22.0,6-2,190.0,Louisville,1824360.0
11 | Marcus Smart,Boston Celtics,36.0,PG,22.0,6-4,220.0,Oklahoma State,3431040.0
12 | Jared Sullinger,Boston Celtics,7.0,C,24.0,6-9,260.0,Ohio State,2569260.0
13 | Isaiah Thomas,Boston Celtics,4.0,PG,27.0,5-9,185.0,Washington,6912869.0
14 | Evan Turner,Boston Celtics,11.0,SG,27.0,6-7,220.0,Ohio State,3425510.0
15 | James Young,Boston Celtics,13.0,SG,20.0,6-6,215.0,Kentucky,1749840.0
16 | Tyler Zeller,Boston Celtics,44.0,C,26.0,7-0,253.0,North Carolina,2616975.0
17 | Bojan Bogdanovic,Brooklyn Nets,44.0,SG,27.0,6-8,216.0,,3425510.0
18 | Markel Brown,Brooklyn Nets,22.0,SG,24.0,6-3,190.0,Oklahoma State,845059.0
19 | Wayne Ellington,Brooklyn Nets,21.0,SG,28.0,6-4,200.0,North Carolina,1500000.0
20 | Rondae Hollis-Jefferson,Brooklyn Nets,24.0,SG,21.0,6-7,220.0,Arizona,1335480.0
21 | Jarrett Jack,Brooklyn Nets,2.0,PG,32.0,6-3,200.0,Georgia Tech,6300000.0
22 | Sergey Karasev,Brooklyn Nets,10.0,SG,22.0,6-7,208.0,,1599840.0
23 | Sean Kilpatrick,Brooklyn Nets,6.0,SG,26.0,6-4,219.0,Cincinnati,134215.0
24 | Shane Larkin,Brooklyn Nets,0.0,PG,23.0,5-11,175.0,Miami (FL),1500000.0
25 | Brook Lopez,Brooklyn Nets,11.0,C,28.0,7-0,275.0,Stanford,19689000.0
26 | Chris McCullough,Brooklyn Nets,1.0,PF,21.0,6-11,200.0,Syracuse,1140240.0
27 | Willie Reed,Brooklyn Nets,33.0,PF,26.0,6-10,220.0,Saint Louis,947276.0
28 | Thomas Robinson,Brooklyn Nets,41.0,PF,25.0,6-10,237.0,Kansas,981348.0
29 | Henry Sims,Brooklyn Nets,14.0,C,26.0,6-10,248.0,Georgetown,947276.0
30 | Donald Sloan,Brooklyn Nets,15.0,PG,28.0,6-3,205.0,Texas A&M,947276.0
31 | Thaddeus Young,Brooklyn Nets,30.0,PF,27.0,6-8,221.0,Georgia Tech,11235955.0
32 | Arron Afflalo,New York Knicks,4.0,SG,30.0,6-5,210.0,UCLA,8000000.0
33 | Lou Amundson,New York Knicks,17.0,PF,33.0,6-9,220.0,UNLV,1635476.0
34 | Thanasis Antetokounmpo,New York Knicks,43.0,SF,23.0,6-7,205.0,,30888.0
35 | Carmelo Anthony,New York Knicks,7.0,SF,32.0,6-8,240.0,Syracuse,22875000.0
36 | Jose Calderon,New York Knicks,3.0,PG,34.0,6-3,200.0,,7402812.0
37 | Cleanthony Early,New York Knicks,11.0,SF,25.0,6-8,210.0,Wichita State,845059.0
38 | Langston Galloway,New York Knicks,2.0,SG,24.0,6-2,200.0,Saint Joseph's,845059.0
39 | Jerian Grant,New York Knicks,13.0,PG,23.0,6-4,195.0,Notre Dame,1572360.0
40 | Robin Lopez,New York Knicks,8.0,C,28.0,7-0,255.0,Stanford,12650000.0
41 | Kyle O'Quinn,New York Knicks,9.0,PF,26.0,6-10,250.0,Norfolk State,3750000.0
42 | Kristaps Porzingis,New York Knicks,6.0,PF,20.0,7-3,240.0,,4131720.0
43 | Kevin Seraphin,New York Knicks,1.0,C,26.0,6-10,278.0,,2814000.0
44 | Lance Thomas,New York Knicks,42.0,SF,28.0,6-8,235.0,Duke,1636842.0
45 | Sasha Vujacic,New York Knicks,18.0,SG,32.0,6-7,195.0,,947276.0
46 | Derrick Williams,New York Knicks,23.0,PF,25.0,6-8,240.0,Arizona,4000000.0
47 | Tony Wroten,New York Knicks,5.0,SG,23.0,6-6,205.0,Washington,167406.0
48 | Elton Brand,Philadelphia 76ers,42.0,PF,37.0,6-9,254.0,Duke,
49 | Isaiah Canaan,Philadelphia 76ers,0.0,PG,25.0,6-0,201.0,Murray State,947276.0
50 | Robert Covington,Philadelphia 76ers,33.0,SF,25.0,6-9,215.0,Tennessee State,1000000.0
51 | Joel Embiid,Philadelphia 76ers,21.0,C,22.0,7-0,250.0,Kansas,4626960.0
52 | Jerami Grant,Philadelphia 76ers,39.0,SF,22.0,6-8,210.0,Syracuse,845059.0
53 | Richaun Holmes,Philadelphia 76ers,22.0,PF,22.0,6-10,245.0,Bowling Green,1074169.0
54 | Carl Landry,Philadelphia 76ers,7.0,PF,32.0,6-9,248.0,Purdue,6500000.0
55 | Kendall Marshall,Philadelphia 76ers,5.0,PG,24.0,6-4,200.0,North Carolina,2144772.0
56 | T.J. McConnell,Philadelphia 76ers,12.0,PG,24.0,6-2,200.0,Arizona,525093.0
57 | Nerlens Noel,Philadelphia 76ers,4.0,PF,22.0,6-11,228.0,Kentucky,3457800.0
58 | Jahlil Okafor,Philadelphia 76ers,8.0,C,20.0,6-11,275.0,Duke,4582680.0
59 | Ish Smith,Philadelphia 76ers,1.0,PG,27.0,6-0,175.0,Wake Forest,947276.0
60 | Nik Stauskas,Philadelphia 76ers,11.0,SG,22.0,6-6,205.0,Michigan,2869440.0
61 | Hollis Thompson,Philadelphia 76ers,31.0,SG,25.0,6-8,206.0,Georgetown,947276.0
62 | Christian Wood,Philadelphia 76ers,35.0,PF,20.0,6-11,220.0,UNLV,525093.0
63 | Bismack Biyombo,Toronto Raptors,8.0,C,23.0,6-9,245.0,,2814000.0
64 | Bruno Caboclo,Toronto Raptors,20.0,SF,20.0,6-9,205.0,,1524000.0
65 | DeMarre Carroll,Toronto Raptors,5.0,SF,29.0,6-8,212.0,Missouri,13600000.0
66 | DeMar DeRozan,Toronto Raptors,10.0,SG,26.0,6-7,220.0,USC,10050000.0
67 | James Johnson,Toronto Raptors,3.0,PF,29.0,6-9,250.0,Wake Forest,2500000.0
68 | Cory Joseph,Toronto Raptors,6.0,PG,24.0,6-3,190.0,Texas,7000000.0
69 | Kyle Lowry,Toronto Raptors,7.0,PG,30.0,6-0,205.0,Villanova,12000000.0
70 | Lucas Nogueira,Toronto Raptors,92.0,C,23.0,7-0,220.0,,1842000.0
71 | Patrick Patterson,Toronto Raptors,54.0,PF,27.0,6-9,235.0,Kentucky,6268675.0
72 | Norman Powell,Toronto Raptors,24.0,SG,23.0,6-4,215.0,UCLA,650000.0
73 | Terrence Ross,Toronto Raptors,31.0,SF,25.0,6-7,195.0,Washington,3553917.0
74 | Luis Scola,Toronto Raptors,4.0,PF,36.0,6-9,240.0,,2900000.0
75 | Jason Thompson,Toronto Raptors,1.0,PF,29.0,6-11,250.0,Rider,245177.0
76 | Jonas Valanciunas,Toronto Raptors,17.0,C,24.0,7-0,255.0,,4660482.0
77 | Delon Wright,Toronto Raptors,55.0,PG,24.0,6-5,190.0,Utah,1509360.0
78 | Leandro Barbosa,Golden State Warriors,19.0,SG,33.0,6-3,194.0,,2500000.0
79 | Harrison Barnes,Golden State Warriors,40.0,SF,24.0,6-8,225.0,North Carolina,3873398.0
80 | Andrew Bogut,Golden State Warriors,12.0,C,31.0,7-0,260.0,Utah,13800000.0
81 | Ian Clark,Golden State Warriors,21.0,SG,25.0,6-3,175.0,Belmont,947276.0
82 | Stephen Curry,Golden State Warriors,30.0,PG,28.0,6-3,190.0,Davidson,11370786.0
83 | Festus Ezeli,Golden State Warriors,31.0,C,26.0,6-11,265.0,Vanderbilt,2008748.0
84 | Draymond Green,Golden State Warriors,23.0,PF,26.0,6-7,230.0,Michigan State,14260870.0
85 | Andre Iguodala,Golden State Warriors,9.0,SF,32.0,6-6,215.0,Arizona,11710456.0
86 | Shaun Livingston,Golden State Warriors,34.0,PG,30.0,6-7,192.0,,5543725.0
87 | Kevon Looney,Golden State Warriors,36.0,SF,20.0,6-9,220.0,UCLA,1131960.0
88 | James Michael McAdoo,Golden State Warriors,20.0,SF,23.0,6-9,240.0,North Carolina,845059.0
89 | Brandon Rush,Golden State Warriors,4.0,SF,30.0,6-6,220.0,Kansas,1270964.0
90 | Marreese Speights,Golden State Warriors,5.0,C,28.0,6-10,255.0,Florida,3815000.0
91 | Klay Thompson,Golden State Warriors,11.0,SG,26.0,6-7,215.0,Washington State,15501000.0
92 | Anderson Varejao,Golden State Warriors,18.0,PF,33.0,6-11,273.0,,289755.0
93 | Cole Aldrich,Los Angeles Clippers,45.0,C,27.0,6-11,250.0,Kansas,1100602.0
94 | Jeff Ayres,Los Angeles Clippers,19.0,PF,29.0,6-9,250.0,Arizona State,111444.0
95 | Jamal Crawford,Los Angeles Clippers,11.0,SG,36.0,6-5,195.0,Michigan,5675000.0
96 | Branden Dawson,Los Angeles Clippers,22.0,SF,23.0,6-6,225.0,Michigan State,525093.0
97 | Jeff Green,Los Angeles Clippers,8.0,SF,29.0,6-9,235.0,Georgetown,9650000.0
98 | Blake Griffin,Los Angeles Clippers,32.0,PF,27.0,6-10,251.0,Oklahoma,18907726.0
99 | Wesley Johnson,Los Angeles Clippers,33.0,SF,28.0,6-7,215.0,Syracuse,1100602.0
100 | DeAndre Jordan,Los Angeles Clippers,6.0,C,27.0,6-11,265.0,Texas A&M,19689000.0
101 | Luc Richard Mbah a Moute,Los Angeles Clippers,12.0,PF,29.0,6-8,230.0,UCLA,947276.0
102 | Chris Paul,Los Angeles Clippers,3.0,PG,31.0,6-0,175.0,Wake Forest,21468695.0
103 | Paul Pierce,Los Angeles Clippers,34.0,SF,38.0,6-7,235.0,Kansas,3376000.0
104 | Pablo Prigioni,Los Angeles Clippers,9.0,PG,39.0,6-3,185.0,,947726.0
105 | JJ Redick,Los Angeles Clippers,4.0,SG,31.0,6-4,190.0,Duke,7085000.0
106 | Austin Rivers,Los Angeles Clippers,25.0,PG,23.0,6-4,200.0,Duke,3110796.0
107 | C.J. Wilcox,Los Angeles Clippers,30.0,SG,25.0,6-5,195.0,Washington,1159680.0
108 | Brandon Bass,Los Angeles Lakers,2.0,PF,31.0,6-8,250.0,LSU,3000000.0
109 | Tarik Black,Los Angeles Lakers,28.0,C,24.0,6-9,250.0,Kansas,845059.0
110 | Anthony Brown,Los Angeles Lakers,3.0,SF,23.0,6-7,210.0,Stanford,700000.0
111 | Kobe Bryant,Los Angeles Lakers,24.0,SF,37.0,6-6,212.0,,25000000.0
112 | Jordan Clarkson,Los Angeles Lakers,6.0,PG,24.0,6-5,194.0,Missouri,845059.0
113 | Roy Hibbert,Los Angeles Lakers,17.0,C,29.0,7-2,270.0,Georgetown,15592217.0
114 | Marcelo Huertas,Los Angeles Lakers,9.0,PG,33.0,6-3,200.0,,525093.0
115 | Ryan Kelly,Los Angeles Lakers,4.0,PF,25.0,6-11,230.0,Duke,1724250.0
116 | Larry Nance Jr.,Los Angeles Lakers,7.0,PF,23.0,6-9,230.0,Wyoming,1155600.0
117 | Julius Randle,Los Angeles Lakers,30.0,PF,21.0,6-9,250.0,Kentucky,3132240.0
118 | D'Angelo Russell,Los Angeles Lakers,1.0,PG,20.0,6-5,195.0,Ohio State,5103120.0
119 | Robert Sacre,Los Angeles Lakers,50.0,C,27.0,7-0,270.0,Gonzaga,981348.0
120 | Louis Williams,Los Angeles Lakers,23.0,SG,29.0,6-1,175.0,,7000000.0
121 | Metta World Peace,Los Angeles Lakers,37.0,SF,36.0,6-7,260.0,St. John's,947276.0
122 | Nick Young,Los Angeles Lakers,0.0,SF,31.0,6-7,210.0,USC,5219169.0
123 | Eric Bledsoe,Phoenix Suns,2.0,PG,26.0,6-1,190.0,Kentucky,13500000.0
124 | Devin Booker,Phoenix Suns,1.0,SG,19.0,6-6,206.0,Kentucky,2127840.0
125 | Chase Budinger,Phoenix Suns,10.0,SF,28.0,6-7,209.0,Arizona,206192.0
126 | Tyson Chandler,Phoenix Suns,4.0,C,33.0,7-1,240.0,,13000000.0
127 | Archie Goodwin,Phoenix Suns,20.0,SG,21.0,6-5,200.0,Kentucky,1160160.0
128 | John Jenkins,Phoenix Suns,23.0,SG,25.0,6-4,215.0,Vanderbilt,981348.0
129 | Brandon Knight,Phoenix Suns,3.0,PG,24.0,6-3,189.0,Kentucky,13500000.0
130 | Alex Len,Phoenix Suns,21.0,C,22.0,7-1,260.0,Maryland,3807120.0
131 | Jon Leuer,Phoenix Suns,30.0,PF,27.0,6-10,228.0,Wisconsin,1035000.0
132 | Phil Pressey,Phoenix Suns,25.0,PG,25.0,5-11,175.0,Missouri,55722.0
133 | Ronnie Price,Phoenix Suns,14.0,PG,32.0,6-2,190.0,Utah Valley,947276.0
134 | Mirza Teletovic,Phoenix Suns,35.0,PF,30.0,6-9,242.0,,5500000.0
135 | P.J. Tucker,Phoenix Suns,17.0,SF,31.0,6-6,245.0,Texas,5500000.0
136 | T.J. Warren,Phoenix Suns,12.0,SF,22.0,6-8,230.0,North Carolina State,2041080.0
137 | Alan Williams,Phoenix Suns,15.0,C,23.0,6-8,260.0,UC Santa Barbara,83397.0
138 | Quincy Acy,Sacramento Kings,13.0,SF,25.0,6-7,240.0,Baylor,981348.0
139 | James Anderson,Sacramento Kings,5.0,SG,27.0,6-6,213.0,Oklahoma State,1015421.0
140 | Marco Belinelli,Sacramento Kings,3.0,SG,30.0,6-5,210.0,,6060606.0
141 | Caron Butler,Sacramento Kings,31.0,SF,36.0,6-7,228.0,Connecticut,1449187.0
142 | Omri Casspi,Sacramento Kings,18.0,SF,27.0,6-9,225.0,,2836186.0
143 | Willie Cauley-Stein,Sacramento Kings,0.0,C,22.0,7-0,240.0,Kentucky,3398280.0
144 | Darren Collison,Sacramento Kings,7.0,PG,28.0,6-0,175.0,UCLA,5013559.0
145 | DeMarcus Cousins,Sacramento Kings,15.0,C,25.0,6-11,270.0,Kentucky,15851950.0
146 | Seth Curry,Sacramento Kings,30.0,SG,25.0,6-2,185.0,Duke,947276.0
147 | Duje Dukan,Sacramento Kings,26.0,PF,24.0,6-9,220.0,Wisconsin,525093.0
148 | Rudy Gay,Sacramento Kings,8.0,SF,29.0,6-8,230.0,Connecticut,12403101.0
149 | Kosta Koufos,Sacramento Kings,41.0,C,27.0,7-0,265.0,Ohio State,7700000.0
150 | Ben McLemore,Sacramento Kings,23.0,SG,23.0,6-5,195.0,Kansas,3156600.0
151 | Eric Moreland,Sacramento Kings,25.0,PF,24.0,6-10,238.0,Oregon State,845059.0
152 | Rajon Rondo,Sacramento Kings,9.0,PG,30.0,6-1,186.0,Kentucky,9500000.0
153 | Cameron Bairstow,Chicago Bulls,41.0,PF,25.0,6-9,250.0,New Mexico,845059.0
154 | Aaron Brooks,Chicago Bulls,0.0,PG,31.0,6-0,161.0,Oregon,2250000.0
155 | Jimmy Butler,Chicago Bulls,21.0,SG,26.0,6-7,220.0,Marquette,16407500.0
156 | Mike Dunleavy,Chicago Bulls,34.0,SG,35.0,6-9,230.0,Duke,4500000.0
157 | Cristiano Felicio,Chicago Bulls,6.0,PF,23.0,6-10,275.0,,525093.0
158 | Pau Gasol,Chicago Bulls,16.0,C,35.0,7-0,250.0,,7448760.0
159 | Taj Gibson,Chicago Bulls,22.0,PF,30.0,6-9,225.0,USC,8500000.0
160 | Justin Holiday,Chicago Bulls,7.0,SG,27.0,6-6,185.0,Washington,947276.0
161 | Doug McDermott,Chicago Bulls,3.0,SF,24.0,6-8,225.0,Creighton,2380440.0
162 | Nikola Mirotic,Chicago Bulls,44.0,PF,25.0,6-10,220.0,,5543725.0
163 | E'Twaun Moore,Chicago Bulls,55.0,SG,27.0,6-4,191.0,Purdue,1015421.0
164 | Joakim Noah,Chicago Bulls,13.0,C,31.0,6-11,232.0,Florida,13400000.0
165 | Bobby Portis,Chicago Bulls,5.0,PF,21.0,6-11,230.0,Arkansas,1391160.0
166 | Derrick Rose,Chicago Bulls,1.0,PG,27.0,6-3,190.0,Memphis,20093064.0
167 | Tony Snell,Chicago Bulls,20.0,SF,24.0,6-7,200.0,New Mexico,1535880.0
168 | Matthew Dellavedova,Cleveland Cavaliers,8.0,PG,25.0,6-4,198.0,Saint Mary's,1147276.0
169 | Channing Frye,Cleveland Cavaliers,9.0,PF,33.0,6-11,255.0,Arizona,8193029.0
170 | Kyrie Irving,Cleveland Cavaliers,2.0,PG,24.0,6-3,193.0,Duke,16407501.0
171 | LeBron James,Cleveland Cavaliers,23.0,SF,31.0,6-8,250.0,,22970500.0
172 | Richard Jefferson,Cleveland Cavaliers,24.0,SF,35.0,6-7,233.0,Arizona,947276.0
173 | Dahntay Jones,Cleveland Cavaliers,30.0,SG,35.0,6-6,225.0,Duke,
174 | James Jones,Cleveland Cavaliers,1.0,SG,35.0,6-8,218.0,Miami (FL),947276.0
175 | Sasha Kaun,Cleveland Cavaliers,14.0,C,31.0,6-11,260.0,Kansas,1276000.0
176 | Kevin Love,Cleveland Cavaliers,0.0,PF,27.0,6-10,251.0,UCLA,19689000.0
177 | Jordan McRae,Cleveland Cavaliers,12.0,SG,25.0,6-5,179.0,Tennessee,111196.0
178 | Timofey Mozgov,Cleveland Cavaliers,20.0,C,29.0,7-1,275.0,,4950000.0
179 | Iman Shumpert,Cleveland Cavaliers,4.0,SG,25.0,6-5,220.0,Georgia Tech,8988765.0
180 | J.R. Smith,Cleveland Cavaliers,5.0,SG,30.0,6-6,225.0,,5000000.0
181 | Tristan Thompson,Cleveland Cavaliers,13.0,C,25.0,6-9,238.0,Texas,14260870.0
182 | Mo Williams,Cleveland Cavaliers,52.0,PG,33.0,6-1,198.0,Alabama,2100000.0
183 | Joel Anthony,Detroit Pistons,50.0,C,33.0,6-9,245.0,UNLV,2500000.0
184 | Aron Baynes,Detroit Pistons,12.0,C,29.0,6-10,260.0,Washington State,6500000.0
185 | Steve Blake,Detroit Pistons,22.0,PG,36.0,6-3,172.0,Maryland,2170465.0
186 | Lorenzo Brown,Detroit Pistons,17.0,PG,25.0,6-5,189.0,North Carolina State,111444.0
187 | Reggie Bullock,Detroit Pistons,25.0,SF,25.0,6-7,205.0,North Carolina,1252440.0
188 | Kentavious Caldwell-Pope,Detroit Pistons,5.0,SG,23.0,6-5,205.0,Georgia,2891760.0
189 | Spencer Dinwiddie,Detroit Pistons,8.0,PG,23.0,6-6,200.0,Colorado,845059.0
190 | Andre Drummond,Detroit Pistons,0.0,C,22.0,6-11,279.0,Connecticut,3272091.0
191 | Tobias Harris,Detroit Pistons,34.0,SF,23.0,6-9,235.0,Tennessee,16000000.0
192 | Darrun Hilliard,Detroit Pistons,6.0,SF,23.0,6-6,205.0,Villanova,600000.0
193 | Reggie Jackson,Detroit Pistons,1.0,PG,26.0,6-3,208.0,Boston College,13913044.0
194 | Stanley Johnson,Detroit Pistons,3.0,SF,20.0,6-7,245.0,Arizona,2841960.0
195 | Jodie Meeks,Detroit Pistons,20.0,SG,28.0,6-4,210.0,Kentucky,6270000.0
196 | Marcus Morris,Detroit Pistons,13.0,PF,26.0,6-9,235.0,Kansas,5000000.0
197 | Anthony Tolliver,Detroit Pistons,43.0,PF,31.0,6-8,240.0,Creighton,3000000.0
198 | Lavoy Allen,Indiana Pacers,5.0,PF,27.0,6-9,255.0,Temple,4050000.0
199 | Rakeem Christmas,Indiana Pacers,25.0,PF,24.0,6-9,250.0,Syracuse,1007026.0
200 | Monta Ellis,Indiana Pacers,11.0,SG,30.0,6-3,185.0,,10300000.0
201 | Paul George,Indiana Pacers,13.0,SF,26.0,6-9,220.0,Fresno State,17120106.0
202 | George Hill,Indiana Pacers,3.0,PG,30.0,6-3,188.0,IUPUI,8000000.0
203 | Jordan Hill,Indiana Pacers,27.0,C,28.0,6-10,235.0,Arizona,4000000.0
204 | Solomon Hill,Indiana Pacers,44.0,SF,25.0,6-7,225.0,Arizona,1358880.0
205 | Ty Lawson,Indiana Pacers,10.0,PG,28.0,5-11,195.0,North Carolina,211744.0
206 | Ian Mahinmi,Indiana Pacers,28.0,C,29.0,6-11,250.0,,4000000.0
207 | C.J. Miles,Indiana Pacers,0.0,SF,29.0,6-6,231.0,,4394225.0
208 | Glenn Robinson III,Indiana Pacers,40.0,SG,22.0,6-7,222.0,Michigan,1100000.0
209 | Rodney Stuckey,Indiana Pacers,2.0,PG,30.0,6-5,205.0,Eastern Washington,7000000.0
210 | Myles Turner,Indiana Pacers,33.0,PF,20.0,6-11,243.0,Texas,2357760.0
211 | Shayne Whittington,Indiana Pacers,42.0,PF,25.0,6-11,250.0,Western Michigan,845059.0
212 | Joe Young,Indiana Pacers,1.0,PG,23.0,6-2,180.0,Oregon,1007026.0
213 | Giannis Antetokounmpo,Milwaukee Bucks,34.0,SF,21.0,6-11,222.0,,1953960.0
214 | Jerryd Bayless,Milwaukee Bucks,19.0,PG,27.0,6-3,200.0,Arizona,3000000.0
215 | Michael Carter-Williams,Milwaukee Bucks,5.0,PG,24.0,6-6,190.0,Syracuse,2399040.0
216 | Jared Cunningham,Milwaukee Bucks,9.0,SG,25.0,6-4,195.0,Oregon State,947276.0
217 | Tyler Ennis,Milwaukee Bucks,11.0,PG,21.0,6-3,194.0,Syracuse,1662360.0
218 | John Henson,Milwaukee Bucks,31.0,PF,25.0,6-11,229.0,North Carolina,2943221.0
219 | Damien Inglis,Milwaukee Bucks,17.0,SF,21.0,6-8,246.0,,855000.0
220 | O.J. Mayo,Milwaukee Bucks,3.0,SG,28.0,6-5,210.0,USC,8000000.0
221 | Khris Middleton,Milwaukee Bucks,22.0,SG,24.0,6-8,234.0,Texas A&M,14700000.0
222 | Greg Monroe,Milwaukee Bucks,15.0,C,26.0,6-11,265.0,Georgetown,16407500.0
223 | Steve Novak,Milwaukee Bucks,6.0,SF,32.0,6-10,225.0,Marquette,295327.0
224 | Johnny O'Bryant III,Milwaukee Bucks,77.0,PF,23.0,6-9,257.0,LSU,845059.0
225 | Jabari Parker,Milwaukee Bucks,12.0,PF,21.0,6-8,250.0,Duke,5152440.0
226 | Miles Plumlee,Milwaukee Bucks,18.0,C,27.0,6-11,249.0,Duke,2109294.0
227 | Greivis Vasquez,Milwaukee Bucks,21.0,PG,29.0,6-6,217.0,Maryland,6600000.0
228 | Rashad Vaughn,Milwaukee Bucks,20.0,SG,19.0,6-6,202.0,UNLV,1733040.0
229 | Justin Anderson,Dallas Mavericks,1.0,SG,22.0,6-6,228.0,Virginia,1449000.0
230 | J.J. Barea,Dallas Mavericks,5.0,PG,31.0,6-0,185.0,Northeastern,4290000.0
231 | Jeremy Evans,Dallas Mavericks,21.0,SF,28.0,6-9,200.0,Western Kentucky,1100602.0
232 | Raymond Felton,Dallas Mavericks,2.0,PG,31.0,6-1,205.0,North Carolina,3950313.0
233 | Devin Harris,Dallas Mavericks,34.0,PG,33.0,6-3,185.0,Wisconsin,4053446.0
234 | David Lee,Dallas Mavericks,42.0,PF,33.0,6-9,245.0,Florida,2085671.0
235 | Wesley Matthews,Dallas Mavericks,23.0,SG,29.0,6-5,220.0,Marquette,16407500.0
236 | JaVale McGee,Dallas Mavericks,11.0,C,28.0,7-0,270.0,Nevada,1270964.0
237 | Salah Mejri,Dallas Mavericks,50.0,C,29.0,7-2,245.0,,525093.0
238 | Dirk Nowitzki,Dallas Mavericks,41.0,PF,37.0,7-0,245.0,,8333334.0
239 | Zaza Pachulia,Dallas Mavericks,27.0,C,32.0,6-11,275.0,,5200000.0
240 | Chandler Parsons,Dallas Mavericks,25.0,SF,27.0,6-10,230.0,Florida,15361500.0
241 | Dwight Powell,Dallas Mavericks,7.0,PF,24.0,6-11,240.0,Stanford,845059.0
242 | Charlie Villanueva,Dallas Mavericks,3.0,PF,31.0,6-11,232.0,Connecticut,947276.0
243 | Deron Williams,Dallas Mavericks,8.0,PG,31.0,6-3,200.0,Illinois,5378974.0
244 | Trevor Ariza,Houston Rockets,1.0,SF,30.0,6-8,215.0,UCLA,8193030.0
245 | Michael Beasley,Houston Rockets,8.0,SF,27.0,6-10,235.0,Kansas State,306527.0
246 | Patrick Beverley,Houston Rockets,2.0,PG,27.0,6-1,185.0,Arkansas,6486486.0
247 | Corey Brewer,Houston Rockets,33.0,SG,30.0,6-9,186.0,Florida,8229375.0
248 | Clint Capela,Houston Rockets,15.0,PF,22.0,6-10,240.0,,1242720.0
249 | Sam Dekker,Houston Rockets,7.0,SF,22.0,6-9,230.0,Wisconsin,1646400.0
250 | Andrew Goudelock,Houston Rockets,0.0,PG,27.0,6-3,200.0,Charleston,200600.0
251 | James Harden,Houston Rockets,13.0,SG,26.0,6-5,220.0,Arizona State,15756438.0
252 | Montrezl Harrell,Houston Rockets,35.0,PF,22.0,6-8,240.0,Louisville,1000000.0
253 | Dwight Howard,Houston Rockets,12.0,C,30.0,6-11,265.0,,22359364.0
254 | Terrence Jones,Houston Rockets,6.0,PF,24.0,6-9,252.0,Kentucky,2489530.0
255 | K.J. McDaniels,Houston Rockets,32.0,SG,23.0,6-6,205.0,Clemson,3189794.0
256 | Donatas Motiejunas,Houston Rockets,20.0,PF,25.0,7-0,222.0,,2288205.0
257 | Josh Smith,Houston Rockets,5.0,C,30.0,6-9,225.0,,947276.0
258 | Jason Terry,Houston Rockets,31.0,SG,38.0,6-2,185.0,Arizona,947276.0
259 | Jordan Adams,Memphis Grizzlies,3.0,SG,21.0,6-5,209.0,UCLA,1404600.0
260 | Tony Allen,Memphis Grizzlies,9.0,SG,34.0,6-4,213.0,Oklahoma State,5158539.0
261 | Chris Andersen,Memphis Grizzlies,7.0,PF,37.0,6-10,245.0,Blinn College,5000000.0
262 | Matt Barnes,Memphis Grizzlies,22.0,SF,36.0,6-7,226.0,UCLA,3542500.0
263 | Vince Carter,Memphis Grizzlies,15.0,SG,39.0,6-6,220.0,North Carolina,4088019.0
264 | Mike Conley,Memphis Grizzlies,11.0,PG,28.0,6-1,175.0,Ohio State,9588426.0
265 | Bryce Cotton,Memphis Grizzlies,8.0,PG,23.0,6-1,165.0,Providence,700902.0
266 | Jordan Farmar,Memphis Grizzlies,4.0,PG,29.0,6-2,180.0,UCLA,
267 | Marc Gasol,Memphis Grizzlies,33.0,C,31.0,7-1,255.0,,19688000.0
268 | JaMychal Green,Memphis Grizzlies,0.0,PF,25.0,6-9,227.0,Alabama,845059.0
269 | P.J. Hairston,Memphis Grizzlies,19.0,SF,23.0,6-6,230.0,North Carolina,1201440.0
270 | Jarell Martin,Memphis Grizzlies,10.0,PF,22.0,6-10,239.0,LSU,1230840.0
271 | Ray McCallum,Memphis Grizzlies,5.0,PG,24.0,6-3,190.0,Detroit,
272 | Xavier Munford,Memphis Grizzlies,14.0,PG,24.0,6-3,180.0,Rhode Island,
273 | Zach Randolph,Memphis Grizzlies,50.0,PF,34.0,6-9,260.0,Michigan State,9638555.0
274 | Lance Stephenson,Memphis Grizzlies,1.0,SF,25.0,6-5,230.0,Cincinnati,9000000.0
275 | Alex Stepheson,Memphis Grizzlies,35.0,PF,28.0,6-10,270.0,USC,
276 | Brandan Wright,Memphis Grizzlies,34.0,PF,28.0,6-10,210.0,North Carolina,5464000.0
277 | Alexis Ajinca,New Orleans Pelicans,42.0,C,28.0,7-2,248.0,,4389607.0
278 | Ryan Anderson,New Orleans Pelicans,33.0,PF,28.0,6-10,240.0,California,8500000.0
279 | Omer Asik,New Orleans Pelicans,3.0,C,29.0,7-0,255.0,,9213483.0
280 | Luke Babbitt,New Orleans Pelicans,8.0,SF,26.0,6-9,225.0,Nevada,1100602.0
281 | Norris Cole,New Orleans Pelicans,30.0,PG,27.0,6-2,175.0,Cleveland State,3036927.0
282 | Dante Cunningham,New Orleans Pelicans,44.0,PF,29.0,6-8,230.0,Villanova,2850000.0
283 | Anthony Davis,New Orleans Pelicans,23.0,PF,23.0,6-10,253.0,Kentucky,7070730.0
284 | Bryce Dejean-Jones,New Orleans Pelicans,31.0,SG,23.0,6-6,203.0,Iowa State,169883.0
285 | Toney Douglas,New Orleans Pelicans,16.0,PG,30.0,6-2,195.0,Florida State,1164858.0
286 | James Ennis,New Orleans Pelicans,4.0,SF,25.0,6-7,210.0,Long Beach State,845059.0
287 | Tyreke Evans,New Orleans Pelicans,1.0,SG,26.0,6-6,220.0,Memphis,10734586.0
288 | Tim Frazier,New Orleans Pelicans,2.0,PG,25.0,6-1,170.0,Penn State,845059.0
289 | Alonzo Gee,New Orleans Pelicans,15.0,SF,29.0,6-6,225.0,Alabama,1320000.0
290 | Eric Gordon,New Orleans Pelicans,10.0,SG,27.0,6-4,215.0,Indiana,15514031.0
291 | Jordan Hamilton,New Orleans Pelicans,25.0,SG,25.0,6-7,220.0,Texas,1015421.0
292 | Jrue Holiday,New Orleans Pelicans,11.0,PG,25.0,6-4,205.0,UCLA,10595507.0
293 | Orlando Johnson,New Orleans Pelicans,0.0,SG,27.0,6-5,220.0,UC Santa Barbara,55722.0
294 | Kendrick Perkins,New Orleans Pelicans,5.0,C,31.0,6-10,270.0,,947276.0
295 | Quincy Pondexter,New Orleans Pelicans,20.0,SF,28.0,6-7,220.0,Washington,3382023.0
296 | LaMarcus Aldridge,San Antonio Spurs,12.0,PF,30.0,6-11,240.0,Texas,19689000.0
297 | Kyle Anderson,San Antonio Spurs,1.0,SF,22.0,6-9,230.0,UCLA,1142880.0
298 | Matt Bonner,San Antonio Spurs,15.0,C,36.0,6-10,235.0,Florida,947276.0
299 | Boris Diaw,San Antonio Spurs,33.0,C,34.0,6-8,250.0,,7500000.0
300 | Tim Duncan,San Antonio Spurs,21.0,C,40.0,6-11,250.0,Wake Forest,5250000.0
301 | Manu Ginobili,San Antonio Spurs,20.0,SG,38.0,6-6,205.0,,2814000.0
302 | Danny Green,San Antonio Spurs,14.0,SG,28.0,6-6,215.0,North Carolina,10000000.0
303 | Kawhi Leonard,San Antonio Spurs,2.0,SF,24.0,6-7,230.0,San Diego State,16407500.0
304 | Boban Marjanovic,San Antonio Spurs,40.0,C,27.0,7-3,290.0,,1200000.0
305 | Kevin Martin,San Antonio Spurs,23.0,SG,33.0,6-7,199.0,Western Carolina,200600.0
306 | Andre Miller,San Antonio Spurs,24.0,PG,40.0,6-3,200.0,Utah,250750.0
307 | Patty Mills,San Antonio Spurs,8.0,PG,27.0,6-0,185.0,Saint Mary's,3578947.0
308 | Tony Parker,San Antonio Spurs,9.0,PG,34.0,6-2,185.0,,13437500.0
309 | Jonathon Simmons,San Antonio Spurs,17.0,SG,26.0,6-6,195.0,Houston,525093.0
310 | David West,San Antonio Spurs,30.0,PF,35.0,6-9,250.0,Xavier,1499187.0
311 | Kent Bazemore,Atlanta Hawks,24.0,SF,26.0,6-5,201.0,Old Dominion,2000000.0
312 | Tim Hardaway Jr.,Atlanta Hawks,10.0,SG,24.0,6-6,205.0,Michigan,1304520.0
313 | Kirk Hinrich,Atlanta Hawks,12.0,SG,35.0,6-4,190.0,Kansas,2854940.0
314 | Al Horford,Atlanta Hawks,15.0,C,30.0,6-10,245.0,Florida,12000000.0
315 | Kris Humphries,Atlanta Hawks,43.0,PF,31.0,6-9,235.0,Minnesota,1000000.0
316 | Kyle Korver,Atlanta Hawks,26.0,SG,35.0,6-7,212.0,Creighton,5746479.0
317 | Paul Millsap,Atlanta Hawks,4.0,PF,31.0,6-8,246.0,Louisiana Tech,18671659.0
318 | Mike Muscala,Atlanta Hawks,31.0,PF,24.0,6-11,240.0,Bucknell,947276.0
319 | Lamar Patterson,Atlanta Hawks,13.0,SG,24.0,6-5,225.0,Pittsburgh,525093.0
320 | Dennis Schroder,Atlanta Hawks,17.0,PG,22.0,6-1,172.0,,1763400.0
321 | Mike Scott,Atlanta Hawks,32.0,PF,27.0,6-8,237.0,Virginia,3333333.0
322 | Thabo Sefolosha,Atlanta Hawks,25.0,SF,32.0,6-7,220.0,,4000000.0
323 | Tiago Splitter,Atlanta Hawks,11.0,C,31.0,6-11,245.0,,9756250.0
324 | Walter Tavares,Atlanta Hawks,22.0,C,24.0,7-3,260.0,,1000000.0
325 | Jeff Teague,Atlanta Hawks,0.0,PG,27.0,6-2,186.0,Wake Forest,8000000.0
326 | Nicolas Batum,Charlotte Hornets,5.0,SG,27.0,6-8,200.0,,13125306.0
327 | Troy Daniels,Charlotte Hornets,30.0,SG,24.0,6-4,205.0,Virginia Commonwealth,947276.0
328 | Jorge Gutierrez,Charlotte Hornets,12.0,PG,27.0,6-3,189.0,California,189455.0
329 | Tyler Hansbrough,Charlotte Hornets,50.0,PF,30.0,6-9,250.0,North Carolina,947276.0
330 | Aaron Harrison,Charlotte Hornets,9.0,SG,21.0,6-6,210.0,Kentucky,525093.0
331 | Spencer Hawes,Charlotte Hornets,0.0,PF,28.0,7-1,245.0,Washington,6110034.0
332 | Al Jefferson,Charlotte Hornets,25.0,C,31.0,6-10,289.0,,13500000.0
333 | Frank Kaminsky III,Charlotte Hornets,44.0,C,23.0,7-0,240.0,Wisconsin,2612520.0
334 | Michael Kidd-Gilchrist,Charlotte Hornets,14.0,SF,22.0,6-7,232.0,Kentucky,6331404.0
335 | Jeremy Lamb,Charlotte Hornets,3.0,SG,24.0,6-5,185.0,Connecticut,3034356.0
336 | Courtney Lee,Charlotte Hornets,1.0,SG,30.0,6-5,200.0,Western Kentucky,5675000.0
337 | Jeremy Lin,Charlotte Hornets,7.0,PG,27.0,6-3,200.0,Harvard,2139000.0
338 | Kemba Walker,Charlotte Hornets,15.0,PG,26.0,6-1,184.0,Connecticut,12000000.0
339 | Marvin Williams,Charlotte Hornets,2.0,PF,29.0,6-9,237.0,North Carolina,7000000.0
340 | Cody Zeller,Charlotte Hornets,40.0,C,23.0,7-0,240.0,Indiana,4204200.0
341 | Chris Bosh,Miami Heat,1.0,PF,32.0,6-11,235.0,Georgia Tech,22192730.0
342 | Luol Deng,Miami Heat,9.0,SF,31.0,6-9,220.0,Duke,10151612.0
343 | Goran Dragic,Miami Heat,7.0,PG,30.0,6-3,190.0,,14783000.0
344 | Gerald Green,Miami Heat,14.0,SF,30.0,6-7,205.0,,947276.0
345 | Udonis Haslem,Miami Heat,40.0,PF,36.0,6-8,235.0,Florida,2854940.0
346 | Joe Johnson,Miami Heat,2.0,SF,34.0,6-7,240.0,Arkansas,261894.0
347 | Tyler Johnson,Miami Heat,8.0,SG,24.0,6-4,186.0,Fresno State,845059.0
348 | Josh McRoberts,Miami Heat,4.0,PF,29.0,6-10,240.0,Duke,5543725.0
349 | Josh Richardson,Miami Heat,0.0,SG,22.0,6-6,200.0,Tennessee,525093.0
350 | Amar'e Stoudemire,Miami Heat,5.0,PF,33.0,6-10,245.0,,947276.0
351 | Dwyane Wade,Miami Heat,3.0,SG,34.0,6-4,220.0,Marquette,20000000.0
352 | Briante Weber,Miami Heat,12.0,PG,23.0,6-2,165.0,Virginia Commonwealth,
353 | Hassan Whiteside,Miami Heat,21.0,C,26.0,7-0,265.0,Marshall,981348.0
354 | Justise Winslow,Miami Heat,20.0,SF,20.0,6-7,225.0,Duke,2481720.0
355 | Dorell Wright,Miami Heat,11.0,SF,30.0,6-9,205.0,,
356 | Dewayne Dedmon,Orlando Magic,3.0,C,26.0,7-0,245.0,USC,947276.0
357 | Evan Fournier,Orlando Magic,10.0,SG,23.0,6-7,205.0,,2288205.0
358 | Aaron Gordon,Orlando Magic,0.0,PF,20.0,6-9,220.0,Arizona,4171680.0
359 | Mario Hezonja,Orlando Magic,23.0,SG,21.0,6-8,218.0,,3741480.0
360 | Ersan Ilyasova,Orlando Magic,7.0,PF,29.0,6-10,235.0,,7900000.0
361 | Brandon Jennings,Orlando Magic,55.0,PG,26.0,6-1,169.0,,8344497.0
362 | Devyn Marble,Orlando Magic,11.0,SF,23.0,6-6,200.0,Iowa,845059.0
363 | Shabazz Napier,Orlando Magic,13.0,PG,24.0,6-1,175.0,Connecticut,1294440.0
364 | Andrew Nicholson,Orlando Magic,44.0,PF,26.0,6-9,250.0,St. Bonaventure,2380593.0
365 | Victor Oladipo,Orlando Magic,5.0,SG,24.0,6-4,210.0,Indiana,5192520.0
366 | Elfrid Payton,Orlando Magic,4.0,PG,22.0,6-4,185.0,Louisiana-Lafayette,2505720.0
367 | Jason Smith,Orlando Magic,14.0,PF,30.0,7-0,240.0,Colorado State,4300000.0
368 | Nikola Vucevic,Orlando Magic,9.0,C,25.0,7-0,260.0,USC,11250000.0
369 | C.J. Watson,Orlando Magic,32.0,PG,32.0,6-2,175.0,Tennessee,5000000.0
370 | Alan Anderson,Washington Wizards,6.0,SG,33.0,6-6,220.0,Michigan State,4000000.0
371 | Bradley Beal,Washington Wizards,3.0,SG,22.0,6-5,207.0,Florida,5694674.0
372 | Jared Dudley,Washington Wizards,1.0,SF,30.0,6-7,225.0,Boston College,4375000.0
373 | Jarell Eddie,Washington Wizards,8.0,SG,24.0,6-7,218.0,Virginia Tech,561716.0
374 | Drew Gooden,Washington Wizards,90.0,PF,34.0,6-10,250.0,Kansas,3300000.0
375 | Marcin Gortat,Washington Wizards,13.0,C,32.0,6-11,240.0,,11217391.0
376 | JJ Hickson,Washington Wizards,21.0,C,27.0,6-9,242.0,North Carolina State,273038.0
377 | Nene Hilario,Washington Wizards,42.0,C,33.0,6-11,250.0,,13000000.0
378 | Markieff Morris,Washington Wizards,5.0,PF,26.0,6-10,245.0,Kansas,8000000.0
379 | Kelly Oubre Jr.,Washington Wizards,12.0,SF,20.0,6-7,205.0,Kansas,1920240.0
380 | Otto Porter Jr.,Washington Wizards,22.0,SF,23.0,6-8,198.0,Georgetown,4662960.0
381 | Ramon Sessions,Washington Wizards,7.0,PG,30.0,6-3,190.0,Nevada,2170465.0
382 | Garrett Temple,Washington Wizards,17.0,SG,30.0,6-6,195.0,LSU,1100602.0
383 | Marcus Thornton,Washington Wizards,15.0,SF,29.0,6-4,205.0,LSU,200600.0
384 | John Wall,Washington Wizards,2.0,PG,25.0,6-4,195.0,Kentucky,15851950.0
385 | Darrell Arthur,Denver Nuggets,0.0,PF,28.0,6-9,235.0,Kansas,2814000.0
386 | D.J. Augustin,Denver Nuggets,12.0,PG,28.0,6-0,183.0,Texas,3000000.0
387 | Will Barton,Denver Nuggets,5.0,SF,25.0,6-6,175.0,Memphis,3533333.0
388 | Wilson Chandler,Denver Nuggets,21.0,SF,29.0,6-8,225.0,DePaul,10449438.0
389 | Kenneth Faried,Denver Nuggets,35.0,PF,26.0,6-8,228.0,Morehead State,11235955.0
390 | Danilo Gallinari,Denver Nuggets,8.0,SF,27.0,6-10,225.0,,14000000.0
391 | Gary Harris,Denver Nuggets,14.0,SG,21.0,6-4,210.0,Michigan State,1584480.0
392 | Nikola Jokic,Denver Nuggets,15.0,C,21.0,6-10,250.0,,1300000.0
393 | Joffrey Lauvergne,Denver Nuggets,77.0,C,24.0,6-11,220.0,,1709719.0
394 | Mike Miller,Denver Nuggets,3.0,SG,36.0,6-8,218.0,Florida,947276.0
395 | Emmanuel Mudiay,Denver Nuggets,0.0,PG,20.0,6-5,200.0,,3102240.0
396 | Jameer Nelson,Denver Nuggets,1.0,PG,34.0,6-0,190.0,Saint Joseph's,4345000.0
397 | Jusuf Nurkic,Denver Nuggets,23.0,C,21.0,7-0,280.0,,1842000.0
398 | JaKarr Sampson,Denver Nuggets,9.0,SG,23.0,6-9,214.0,St. John's,258489.0
399 | Axel Toupane,Denver Nuggets,6.0,SG,23.0,6-7,210.0,,
400 | Nemanja Bjelica,Minnesota Timberwolves,88.0,PF,28.0,6-10,240.0,,3950001.0
401 | Gorgui Dieng,Minnesota Timberwolves,5.0,C,26.0,6-11,241.0,Louisville,1474440.0
402 | Kevin Garnett,Minnesota Timberwolves,21.0,PF,40.0,6-11,240.0,,8500000.0
403 | Tyus Jones,Minnesota Timberwolves,1.0,PG,20.0,6-2,195.0,Duke,1282080.0
404 | Zach LaVine,Minnesota Timberwolves,8.0,PG,21.0,6-5,189.0,UCLA,2148360.0
405 | Shabazz Muhammad,Minnesota Timberwolves,15.0,SF,23.0,6-6,223.0,UCLA,2056920.0
406 | Adreian Payne,Minnesota Timberwolves,33.0,PF,25.0,6-10,237.0,Michigan State,1938840.0
407 | Nikola Pekovic,Minnesota Timberwolves,14.0,C,30.0,6-11,307.0,,12100000.0
408 | Tayshaun Prince,Minnesota Timberwolves,12.0,SF,36.0,6-9,212.0,Kentucky,947276.0
409 | Ricky Rubio,Minnesota Timberwolves,9.0,PG,25.0,6-4,194.0,,12700000.0
410 | Damjan Rudez,Minnesota Timberwolves,10.0,SF,29.0,6-9,230.0,,1149500.0
411 | Greg Smith,Minnesota Timberwolves,4.0,PF,25.0,6-10,250.0,Fresno State,
412 | Karl-Anthony Towns,Minnesota Timberwolves,32.0,C,20.0,7-0,244.0,Kentucky,5703600.0
413 | Andrew Wiggins,Minnesota Timberwolves,22.0,SG,21.0,6-8,199.0,Kansas,5758680.0
414 | Steven Adams,Oklahoma City Thunder,12.0,C,22.0,7-0,255.0,Pittsburgh,2279040.0
415 | Nick Collison,Oklahoma City Thunder,4.0,PF,35.0,6-10,255.0,Kansas,3750000.0
416 | Kevin Durant,Oklahoma City Thunder,35.0,SF,27.0,6-9,240.0,Texas,20158622.0
417 | Randy Foye,Oklahoma City Thunder,6.0,SG,32.0,6-4,213.0,Villanova,3135000.0
418 | Josh Huestis,Oklahoma City Thunder,34.0,SF,24.0,6-7,230.0,Stanford,1140240.0
419 | Serge Ibaka,Oklahoma City Thunder,9.0,PF,26.0,6-10,245.0,,12250000.0
420 | Enes Kanter,Oklahoma City Thunder,11.0,C,24.0,6-11,245.0,Kentucky,16407500.0
421 | Mitch McGary,Oklahoma City Thunder,33.0,PF,24.0,6-10,255.0,Michigan,1463040.0
422 | Nazr Mohammed,Oklahoma City Thunder,13.0,C,38.0,6-10,250.0,Kentucky,222888.0
423 | Anthony Morrow,Oklahoma City Thunder,2.0,SG,30.0,6-5,210.0,Georgia Tech,3344000.0
424 | Cameron Payne,Oklahoma City Thunder,22.0,PG,21.0,6-3,185.0,Murray State,2021520.0
425 | Andre Roberson,Oklahoma City Thunder,21.0,SG,24.0,6-7,210.0,Colorado,1210800.0
426 | Kyle Singler,Oklahoma City Thunder,5.0,SF,28.0,6-8,228.0,Duke,4500000.0
427 | Dion Waiters,Oklahoma City Thunder,3.0,SG,24.0,6-4,220.0,Syracuse,5138430.0
428 | Russell Westbrook,Oklahoma City Thunder,0.0,PG,27.0,6-3,200.0,UCLA,16744218.0
429 | Cliff Alexander,Portland Trail Blazers,34.0,PF,20.0,6-8,240.0,Kansas,525093.0
430 | Al-Farouq Aminu,Portland Trail Blazers,8.0,SF,25.0,6-9,215.0,Wake Forest,8042895.0
431 | Pat Connaughton,Portland Trail Blazers,5.0,SG,23.0,6-5,206.0,Notre Dame,625093.0
432 | Allen Crabbe,Portland Trail Blazers,23.0,SG,24.0,6-6,210.0,California,947276.0
433 | Ed Davis,Portland Trail Blazers,17.0,C,27.0,6-10,240.0,North Carolina,6980802.0
434 | Maurice Harkless,Portland Trail Blazers,4.0,SF,23.0,6-9,215.0,St. John's,2894059.0
435 | Gerald Henderson,Portland Trail Blazers,9.0,SG,28.0,6-5,215.0,Duke,6000000.0
436 | Chris Kaman,Portland Trail Blazers,35.0,C,34.0,7-0,265.0,Central Michigan,5016000.0
437 | Meyers Leonard,Portland Trail Blazers,11.0,PF,24.0,7-1,245.0,Illinois,3075880.0
438 | Damian Lillard,Portland Trail Blazers,0.0,PG,25.0,6-3,195.0,Weber State,4236287.0
439 | C.J. McCollum,Portland Trail Blazers,3.0,SG,24.0,6-4,200.0,Lehigh,2525160.0
440 | Luis Montero,Portland Trail Blazers,44.0,SG,23.0,6-7,185.0,Westchester CC,525093.0
441 | Mason Plumlee,Portland Trail Blazers,24.0,C,26.0,6-11,235.0,Duke,1415520.0
442 | Brian Roberts,Portland Trail Blazers,2.0,PG,30.0,6-1,173.0,Dayton,2854940.0
443 | Noah Vonleh,Portland Trail Blazers,21.0,PF,20.0,6-9,240.0,Indiana,2637720.0
444 | Trevor Booker,Utah Jazz,33.0,PF,28.0,6-8,228.0,Clemson,4775000.0
445 | Trey Burke,Utah Jazz,3.0,PG,23.0,6-1,191.0,Michigan,2658240.0
446 | Alec Burks,Utah Jazz,10.0,SG,24.0,6-6,214.0,Colorado,9463484.0
447 | Dante Exum,Utah Jazz,11.0,PG,20.0,6-6,190.0,,3777720.0
448 | Derrick Favors,Utah Jazz,15.0,PF,24.0,6-10,265.0,Georgia Tech,12000000.0
449 | Rudy Gobert,Utah Jazz,27.0,C,23.0,7-1,245.0,,1175880.0
450 | Gordon Hayward,Utah Jazz,20.0,SF,26.0,6-8,226.0,Butler,15409570.0
451 | Rodney Hood,Utah Jazz,5.0,SG,23.0,6-8,206.0,Duke,1348440.0
452 | Joe Ingles,Utah Jazz,2.0,SF,28.0,6-8,226.0,,2050000.0
453 | Chris Johnson,Utah Jazz,23.0,SF,26.0,6-6,206.0,Dayton,981348.0
454 | Trey Lyles,Utah Jazz,41.0,PF,20.0,6-10,234.0,Kentucky,2239800.0
455 | Shelvin Mack,Utah Jazz,8.0,PG,26.0,6-3,203.0,Butler,2433333.0
456 | Raul Neto,Utah Jazz,25.0,PG,24.0,6-1,179.0,,900000.0
457 | Tibor Pleiss,Utah Jazz,21.0,C,26.0,7-3,256.0,,2900000.0
458 | Jeff Withey,Utah Jazz,24.0,C,26.0,7-0,231.0,Kansas,947276.0
459 | ,,,,,,,,
460 |
--------------------------------------------------------------------------------
/datasets/pokemon.csv:
--------------------------------------------------------------------------------
1 | Pokemon,Type
2 | Bulbasaur,Grass
3 | Ivysaur,Grass
4 | Venusaur,Grass
5 | Charmander,Fire
6 | Charmeleon,Fire
7 | Charizard,Fire
8 | Squirtle,Water
9 | Wartortle,Water
10 | Blastoise,Water
11 | Caterpie,Bug
12 | Metapod,Bug
13 | Butterfree,Bug
14 | Weedle,Bug
15 | Kakuna,Bug
16 | Beedrill,Bug
17 | Pidgey,Normal
18 | Pidgeotto,Normal
19 | Pidgeot,Normal
20 | Rattata,Normal
21 | Raticate,Normal
22 | Spearow,Normal
23 | Fearow,Normal
24 | Ekans,Poison
25 | Arbok,Poison
26 | Pikachu,Electric
27 | Raichu,Electric
28 | Sandshrew,Ground
29 | Sandslash,Ground
30 | Nidoran,Poison
31 | Nidorina,Poison
32 | Nidoqueen,Poison
33 | Nidoran♂,Poison
34 | Nidorino,Poison
35 | Nidoking,Poison
36 | Clefairy,Fairy
37 | Clefable,Fairy
38 | Vulpix,Fire
39 | Ninetales,Fire
40 | Jigglypuff,Normal
41 | Wigglytuff,Normal
42 | Zubat,Poison
43 | Golbat,Poison
44 | Oddish,Grass
45 | Gloom,Grass
46 | Vileplume,Grass
47 | Paras,Bug
48 | Parasect,Bug
49 | Venonat,Bug
50 | Venomoth,Bug
51 | Diglett,Ground
52 | Dugtrio,Ground
53 | Meowth,Normal
54 | Persian,Normal
55 | Psyduck,Water
56 | Golduck,Water
57 | Mankey,Fighting
58 | Primeape,Fighting
59 | Growlithe,Fire
60 | Arcanine,Fire
61 | Poliwag,Water
62 | Poliwhirl,Water
63 | Poliwrath,Water
64 | Abra,Psychic
65 | Kadabra,Psychic
66 | Alakazam,Psychic
67 | Machop,Fighting
68 | Machoke,Fighting
69 | Machamp,Fighting
70 | Bellsprout,Grass
71 | Weepinbell,Grass
72 | Victreebel,Grass
73 | Tentacool,Water
74 | Tentacruel,Water
75 | Geodude,Rock
76 | Graveler,Rock
77 | Golem,Rock
78 | Ponyta,Fire
79 | Rapidash,Fire
80 | Slowpoke,Water
81 | Slowbro,Water
82 | Magnemite,Electric
83 | Magneton,Electric
84 | Farfetch'd,Normal
85 | Doduo,Normal
86 | Dodrio,Normal
87 | Seel,Water
88 | Dewgong,Water
89 | Grimer,Poison
90 | Muk,Poison
91 | Shellder,Water
92 | Cloyster,Water
93 | Gastly,Ghost
94 | Haunter,Ghost
95 | Gengar,Ghost
96 | Onix,Rock
97 | Drowzee,Psychic
98 | Hypno,Psychic
99 | Krabby,Water
100 | Kingler,Water
101 | Voltorb,Electric
102 | Electrode,Electric
103 | Exeggcute,Grass
104 | Exeggutor,Grass
105 | Cubone,Ground
106 | Marowak,Ground
107 | Hitmonlee,Fighting
108 | Hitmonchan,Fighting
109 | Lickitung,Normal
110 | Koffing,Poison
111 | Weezing,Poison
112 | Rhyhorn,Ground
113 | Rhydon,Ground
114 | Chansey,Normal
115 | Tangela,Grass
116 | Kangaskhan,Normal
117 | Horsea,Water
118 | Seadra,Water
119 | Goldeen,Water
120 | Seaking,Water
121 | Staryu,Water
122 | Starmie,Water
123 | Mr. Mime,Psychic
124 | Scyther,Bug
125 | Jynx,Ice
126 | Electabuzz,Electric
127 | Magmar,Fire
128 | Pinsir,Bug
129 | Tauros,Normal
130 | Magikarp,Water
131 | Gyarados,Water
132 | Lapras,Water
133 | Ditto,Normal
134 | Eevee,Normal
135 | Vaporeon,Water
136 | Jolteon,Electric
137 | Flareon,Fire
138 | Porygon,Normal
139 | Omanyte,Rock
140 | Omastar,Rock
141 | Kabuto,Rock
142 | Kabutops,Rock
143 | Aerodactyl,Rock
144 | Snorlax,Normal
145 | Articuno,Ice
146 | Zapdos,Electric
147 | Moltres,Fire
148 | Dratini,Dragon
149 | Dragonair,Dragon
150 | Dragonite,Dragon
151 | Mewtwo,Psychic
152 | Mew,Psychic
153 | Chikorita,Grass
154 | Bayleef,Grass
155 | Meganium,Grass
156 | Cyndaquil,Fire
157 | Quilava,Fire
158 | Typhlosion,Fire
159 | Totodile,Water
160 | Croconaw,Water
161 | Feraligatr,Water
162 | Sentret,Normal
163 | Furret,Normal
164 | Hoothoot,Normal
165 | Noctowl,Normal
166 | Ledyba,Bug
167 | Ledian,Bug
168 | Spinarak,Bug
169 | Ariados,Bug
170 | Crobat,Poison
171 | Chinchou,Water
172 | Lanturn,Water
173 | Pichu,Electric
174 | Cleffa,Fairy
175 | Igglybuff,Normal
176 | Togepi,Fairy
177 | Togetic,Fairy
178 | Natu,Psychic
179 | Xatu,Psychic
180 | Mareep,Electric
181 | Flaaffy,Electric
182 | Ampharos,Electric
183 | Bellossom,Grass
184 | Marill,Water
185 | Azumarill,Water
186 | Sudowoodo,Rock
187 | Politoed,Water
188 | Hoppip,Grass
189 | Skiploom,Grass
190 | Jumpluff,Grass
191 | Aipom,Normal
192 | Sunkern,Grass
193 | Sunflora,Grass
194 | Yanma,Bug
195 | Wooper,Water
196 | Quagsire,Water
197 | Espeon,Psychic
198 | Umbreon,Dark
199 | Murkrow,Dark
200 | Slowking,Water
201 | Misdreavus,Ghost
202 | Unown,Psychic
203 | Wobbuffet,Psychic
204 | Girafarig,Normal
205 | Pineco,Bug
206 | Forretress,Bug
207 | Dunsparce,Normal
208 | Gligar,Ground
209 | Steelix,Steel
210 | Snubbull,Fairy
211 | Granbull,Fairy
212 | Qwilfish,Water
213 | Scizor,Bug
214 | Shuckle,Bug
215 | Heracross,Bug
216 | Sneasel,Dark
217 | Teddiursa,Normal
218 | Ursaring,Normal
219 | Slugma,Fire
220 | Magcargo,Fire
221 | Swinub,Ice
222 | Piloswine,Ice
223 | Corsola,Water
224 | Remoraid,Water
225 | Octillery,Water
226 | Delibird,Ice
227 | Mantine,Water
228 | Skarmory,Steel
229 | Houndour,Dark
230 | Houndoom,Dark
231 | Kingdra,Water
232 | Phanpy,Ground
233 | Donphan,Ground
234 | Porygon2,Normal
235 | Stantler,Normal
236 | Smeargle,Normal
237 | Tyrogue,Fighting
238 | Hitmontop,Fighting
239 | Smoochum,Ice
240 | Elekid,Electric
241 | Magby,Fire
242 | Miltank,Normal
243 | Blissey,Normal
244 | Raikou,Electric
245 | Entei,Fire
246 | Suicune,Water
247 | Larvitar,Rock
248 | Pupitar,Rock
249 | Tyranitar,Rock
250 | Lugia,Psychic
251 | Ho-oh,Fire
252 | Celebi,Psychic
253 | Treecko,Grass
254 | Grovyle,Grass
255 | Sceptile,Grass
256 | Torchic,Fire
257 | Combusken,Fire
258 | Blaziken,Fire
259 | Mudkip,Water
260 | Marshtomp,Water
261 | Swampert,Water
262 | Poochyena,Dark
263 | Mightyena,Dark
264 | Zigzagoon,Normal
265 | Linoone,Normal
266 | Wurmple,Bug
267 | Silcoon,Bug
268 | Beautifly,Bug
269 | Cascoon,Bug
270 | Dustox,Bug
271 | Lotad,Water
272 | Lombre,Water
273 | Ludicolo,Water
274 | Seedot,Grass
275 | Nuzleaf,Grass
276 | Shiftry,Grass
277 | Taillow,Normal
278 | Swellow,Normal
279 | Wingull,Water
280 | Pelipper,Water
281 | Ralts,Psychic
282 | Kirlia,Psychic
283 | Gardevoir,Psychic
284 | Surskit,Bug
285 | Masquerain,Bug
286 | Shroomish,Grass
287 | Breloom,Grass
288 | Slakoth,Normal
289 | Vigoroth,Normal
290 | Slaking,Normal
291 | Nincada,Bug
292 | Ninjask,Bug
293 | Shedinja,Bug
294 | Whismur,Normal
295 | Loudred,Normal
296 | Exploud,Normal
297 | Makuhita,Fighting
298 | Hariyama,Fighting
299 | Azurill,Normal
300 | Nosepass,Rock
301 | Skitty,Normal
302 | Delcatty,Normal
303 | Sableye,Dark
304 | Mawile,Steel
305 | Aron,Steel
306 | Lairon,Steel
307 | Aggron,Steel
308 | Meditite,Fighting
309 | Medicham,Fighting
310 | Electrike,Electric
311 | Manectric,Electric
312 | Plusle,Electric
313 | Minun,Electric
314 | Volbeat,Bug
315 | Illumise,Bug
316 | Roselia,Grass
317 | Gulpin,Poison
318 | Swalot,Poison
319 | Carvanha,Water
320 | Sharpedo,Water
321 | Wailmer,Water
322 | Wailord,Water
323 | Numel,Fire
324 | Camerupt,Fire
325 | Torkoal,Fire
326 | Spoink,Psychic
327 | Grumpig,Psychic
328 | Spinda,Normal
329 | Trapinch,Ground
330 | Vibrava,Ground
331 | Flygon,Ground
332 | Cacnea,Grass
333 | Cacturne,Grass
334 | Swablu,Normal
335 | Altaria,Dragon
336 | Zangoose,Normal
337 | Seviper,Poison
338 | Lunatone,Rock
339 | Solrock,Rock
340 | Barboach,Water
341 | Whiscash,Water
342 | Corphish,Water
343 | Crawdaunt,Water
344 | Baltoy,Ground
345 | Claydol,Ground
346 | Lileep,Rock
347 | Cradily,Rock
348 | Anorith,Rock
349 | Armaldo,Rock
350 | Feebas,Water
351 | Milotic,Water
352 | Castform,Normal
353 | Kecleon,Normal
354 | Shuppet,Ghost
355 | Banette,Ghost
356 | Duskull,Ghost
357 | Dusclops,Ghost
358 | Tropius,Grass
359 | Chimecho,Psychic
360 | Absol,Dark
361 | Wynaut,Psychic
362 | Snorunt,Ice
363 | Glalie,Ice
364 | Spheal,Ice
365 | Sealeo,Ice
366 | Walrein,Ice
367 | Clamperl,Water
368 | Huntail,Water
369 | Gorebyss,Water
370 | Relicanth,Water
371 | Luvdisc,Water
372 | Bagon,Dragon
373 | Shelgon,Dragon
374 | Salamence,Dragon
375 | Beldum,Steel
376 | Metang,Steel
377 | Metagross,Steel
378 | Regirock,Rock
379 | Regice,Ice
380 | Registeel,Steel
381 | Latias,Dragon
382 | Latios,Dragon
383 | Kyogre,Water
384 | Groudon,Ground
385 | Rayquaza,Dragon
386 | Jirachi,Steel
387 | Deoxys,Psychic
388 | Turtwig,Grass
389 | Grotle,Grass
390 | Torterra,Grass
391 | Chimchar,Fire
392 | Monferno,Fire
393 | Infernape,Fire
394 | Piplup,Water
395 | Prinplup,Water
396 | Empoleon,Water
397 | Starly,Normal
398 | Staravia,Normal
399 | Staraptor,Normal
400 | Bidoof,Normal
401 | Bibarel,Normal
402 | Kricketot,Bug
403 | Kricketune,Bug
404 | Shinx,Electric
405 | Luxio,Electric
406 | Luxray,Electric
407 | Budew,Grass
408 | Roserade,Grass
409 | Cranidos,Rock
410 | Rampardos,Rock
411 | Shieldon,Rock
412 | Bastiodon,Rock
413 | Burmy,Bug
414 | Wormadam,Bug
415 | Mothim,Bug
416 | Combee,Bug
417 | Vespiquen,Bug
418 | Pachirisu,Electric
419 | Buizel,Water
420 | Floatzel,Water
421 | Cherubi,Grass
422 | Cherrim,Grass
423 | Shellos,Water
424 | Gastrodon,Water
425 | Ambipom,Normal
426 | Drifloon,Ghost
427 | Drifblim,Ghost
428 | Buneary,Normal
429 | Lopunny,Normal
430 | Mismagius,Ghost
431 | Honchkrow,Dark
432 | Glameow,Normal
433 | Purugly,Normal
434 | Chingling,Psychic
435 | Stunky,Poison
436 | Skuntank,Poison
437 | Bronzor,Steel
438 | Bronzong,Steel
439 | Bonsly,Rock
440 | Mime Jr.,Psychic
441 | Happiny,Normal
442 | Chatot,Normal
443 | Spiritomb,Ghost
444 | Gible,Dragon
445 | Gabite,Dragon
446 | Garchomp,Dragon
447 | Munchlax,Normal
448 | Riolu,Fighting
449 | Lucario,Fighting
450 | Hippopotas,Ground
451 | Hippowdon,Ground
452 | Skorupi,Poison
453 | Drapion,Poison
454 | Croagunk,Poison
455 | Toxicroak,Poison
456 | Carnivine,Grass
457 | Finneon,Water
458 | Lumineon,Water
459 | Mantyke,Water
460 | Snover,Grass
461 | Abomasnow,Grass
462 | Weavile,Dark
463 | Magnezone,Electric
464 | Lickilicky,Normal
465 | Rhyperior,Ground
466 | Tangrowth,Grass
467 | Electivire,Electric
468 | Magmortar,Fire
469 | Togekiss,Fairy
470 | Yanmega,Bug
471 | Leafeon,Grass
472 | Glaceon,Ice
473 | Gliscor,Ground
474 | Mamoswine,Ice
475 | Porygon-Z,Normal
476 | Gallade,Psychic
477 | Probopass,Rock
478 | Dusknoir,Ghost
479 | Froslass,Ice
480 | Rotom,Electric
481 | Uxie,Psychic
482 | Mesprit,Psychic
483 | Azelf,Psychic
484 | Dialga,Steel
485 | Palkia,Water
486 | Heatran,Fire
487 | Regigigas,Normal
488 | Giratina,Ghost
489 | Cresselia,Psychic
490 | Phione,Water
491 | Manaphy,Water
492 | Darkrai,Dark
493 | Shaymin,Grass
494 | Arceus,Normal
495 | Victini,Psychic
496 | Snivy,Grass
497 | Servine,Grass
498 | Serperior,Grass
499 | Tepig,Fire
500 | Pignite,Fire
501 | Emboar,Fire
502 | Oshawott,Water
503 | Dewott,Water
504 | Samurott,Water
505 | Patrat,Normal
506 | Watchog,Normal
507 | Lillipup,Normal
508 | Herdier,Normal
509 | Stoutland,Normal
510 | Purrloin,Dark
511 | Liepard,Dark
512 | Pansage,Grass
513 | Simisage,Grass
514 | Pansear,Fire
515 | Simisear,Fire
516 | Panpour,Water
517 | Simipour,Water
518 | Munna,Psychic
519 | Musharna,Psychic
520 | Pidove,Normal
521 | Tranquill,Normal
522 | Unfezant,Normal
523 | Blitzle,Electric
524 | Zebstrika,Electric
525 | Roggenrola,Rock
526 | Boldore,Rock
527 | Gigalith,Rock
528 | Woobat,Psychic
529 | Swoobat,Psychic
530 | Drilbur,Ground
531 | Excadrill,Ground
532 | Audino,Normal
533 | Timburr,Fighting
534 | Gurdurr,Fighting
535 | Conkeldurr,Fighting
536 | Tympole,Water
537 | Palpitoad,Water
538 | Seismitoad,Water
539 | Throh,Fighting
540 | Sawk,Fighting
541 | Sewaddle,Bug
542 | Swadloon,Bug
543 | Leavanny,Bug
544 | Venipede,Bug
545 | Whirlipede,Bug
546 | Scolipede,Bug
547 | Cottonee,Grass
548 | Whimsicott,Grass
549 | Petilil,Grass
550 | Lilligant,Grass
551 | Basculin,Water
552 | Sandile,Ground
553 | Krokorok,Ground
554 | Krookodile,Ground
555 | Darumaka,Fire
556 | Darmanitan,Fire
557 | Maractus,Grass
558 | Dwebble,Bug
559 | Crustle,Bug
560 | Scraggy,Dark
561 | Scrafty,Dark
562 | Sigilyph,Psychic
563 | Yamask,Ghost
564 | Cofagrigus,Ghost
565 | Tirtouga,Water
566 | Carracosta,Water
567 | Archen,Rock
568 | Archeops,Rock
569 | Trubbish,Poison
570 | Garbodor,Poison
571 | Zorua,Dark
572 | Zoroark,Dark
573 | Minccino,Normal
574 | Cinccino,Normal
575 | Gothita,Psychic
576 | Gothorita,Psychic
577 | Gothitelle,Psychic
578 | Solosis,Psychic
579 | Duosion,Psychic
580 | Reuniclus,Psychic
581 | Ducklett,Water
582 | Swanna,Water
583 | Vanillite,Ice
584 | Vanillish,Ice
585 | Vanilluxe,Ice
586 | Deerling,Normal
587 | Sawsbuck,Normal
588 | Emolga,Electric
589 | Karrablast,Bug
590 | Escavalier,Bug
591 | Foongus,Grass
592 | Amoonguss,Grass
593 | Frillish,Water
594 | Jellicent,Water
595 | Alomomola,Water
596 | Joltik,Bug
597 | Galvantula,Bug
598 | Ferroseed,Grass
599 | Ferrothorn,Grass
600 | Klink,Steel
601 | Klang,Steel
602 | Klinklang,Steel
603 | Tynamo,Electric
604 | Eelektrik,Electric
605 | Eelektross,Electric
606 | Elgyem,Psychic
607 | Beheeyem,Psychic
608 | Litwick,Ghost
609 | Lampent,Ghost
610 | Chandelure,Ghost
611 | Axew,Dragon
612 | Fraxure,Dragon
613 | Haxorus,Dragon
614 | Cubchoo,Ice
615 | Beartic,Ice
616 | Cryogonal,Ice
617 | Shelmet,Bug
618 | Accelgor,Bug
619 | Stunfisk,Ground
620 | Mienfoo,Fighting
621 | Mienshao,Fighting
622 | Druddigon,Dragon
623 | Golett,Ground
624 | Golurk,Ground
625 | Pawniard,Dark
626 | Bisharp,Dark
627 | Bouffalant,Normal
628 | Rufflet,Normal
629 | Braviary,Normal
630 | Vullaby,Dark
631 | Mandibuzz,Dark
632 | Heatmor,Fire
633 | Durant,Bug
634 | Deino,Dark
635 | Zweilous,Dark
636 | Hydreigon,Dark
637 | Larvesta,Bug
638 | Volcarona,Bug
639 | Cobalion,Steel
640 | Terrakion,Rock
641 | Virizion,Grass
642 | Tornadus,Flying
643 | Thundurus,Electric
644 | Reshiram,Dragon
645 | Zekrom,Dragon
646 | Landorus,Ground
647 | Kyurem,Dragon
648 | Keldeo,Water
649 | Meloetta,Normal
650 | Genesect,Bug
651 | Chespin,Grass
652 | Quilladin,Grass
653 | Chesnaught,Grass
654 | Fennekin,Fire
655 | Braixen,Fire
656 | Delphox,Fire
657 | Froakie,Water
658 | Frogadier,Water
659 | Greninja,Water
660 | Bunnelby,Normal
661 | Diggersby,Normal
662 | Fletchling,Normal
663 | Fletchinder,Fire
664 | Talonflame,Fire
665 | Scatterbug,Bug
666 | Spewpa,Bug
667 | Vivillon,Bug
668 | Litleo,Fire
669 | Pyroar,Fire
670 | Flabébé,Fairy
671 | Floette,Fairy
672 | Florges,Fairy
673 | Skiddo,Grass
674 | Gogoat,Grass
675 | Pancham,Fighting
676 | Pangoro,Fighting
677 | Furfrou,Normal
678 | Espurr,Psychic
679 | Meowstic,Psychic
680 | Honedge,Steel
681 | Doublade,Steel
682 | Aegislash,Steel
683 | Spritzee,Fairy
684 | Aromatisse,Fairy
685 | Swirlix,Fairy
686 | Slurpuff,Fairy
687 | Inkay,Dark
688 | Malamar,Dark
689 | Binacle,Rock
690 | Barbaracle,Rock
691 | Skrelp,Poison
692 | Dragalge,Poison
693 | Clauncher,Water
694 | Clawitzer,Water
695 | Helioptile,Electric
696 | Heliolisk,Electric
697 | Tyrunt,Rock
698 | Tyrantrum,Rock
699 | Amaura,Rock
700 | Aurorus,Rock
701 | Sylveon,Fairy
702 | Hawlucha,Fighting
703 | Dedenne,Electric
704 | Carbink,Rock
705 | Goomy,Dragon
706 | Sliggoo,Dragon
707 | Goodra,Dragon
708 | Klefki,Steel
709 | Phantump,Ghost
710 | Trevenant,Ghost
711 | Pumpkaboo,Ghost
712 | Gourgeist,Ghost
713 | Bergmite,Ice
714 | Avalugg,Ice
715 | Noibat,Flying
716 | Noivern,Flying
717 | Xerneas,Fairy
718 | Yveltal,Dark
719 | Zygarde,Dragon
720 | Diancie,Rock
721 | Hoopa,Psychic
722 | Volcanion,Fire
723 |
--------------------------------------------------------------------------------
/datasets/quarters.csv:
--------------------------------------------------------------------------------
1 | Salesman,Q1,Q2,Q3,Q4
2 | Boris,602908,233879,354479,32704
3 | Bob,43790,514863,297151,544493
4 | Tommy,392668,113579,430882,247231
5 | Travis,834663,266785,749238,570524
6 | Donald,580935,411379,110390,651572
7 | Ted,656644,70803,375948,321388
8 | Jeb,486141,600753,742716,404995
9 | Stacy,479662,742806,770712,2501
10 | Morgan,992673,879183,37945,293710
--------------------------------------------------------------------------------
/datasets/revenue.csv:
--------------------------------------------------------------------------------
1 | Date,New York,Los Angeles,Miami
2 | 1/1/16,985,122,499
3 | 1/2/16,738,788,534
4 | 1/3/16,14,20,933
5 | 1/4/16,730,904,885
6 | 1/5/16,114,71,253
7 | 1/6/16,936,502,497
8 | 1/7/16,123,996,115
9 | 1/8/16,935,492,886
10 | 1/9/16,846,954,823
11 | 1/10/16,54,285,216
--------------------------------------------------------------------------------
/file.txt:
--------------------------------------------------------------------------------
1 | Have faith and patience
2 | Rest in hand of THE God
3 |
--------------------------------------------------------------------------------
/foo.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | """
3 | This is foo's doc string
4 | """
5 | print("Hello, I'm foo")
6 | return
--------------------------------------------------------------------------------
/mydb.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/mydb.db
--------------------------------------------------------------------------------
/myplot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gekko12/Python_Notebooks/d823f0ab440dc88f4bbdc922a6615cee2d3775a3/myplot.png
--------------------------------------------------------------------------------