분류 전체보기
-
Python - Pandas Fundamentals Revisitedpython 2022. 8. 26. 17:19
Pandas is a library that allows us to manipulate tabular data(think of Excel spreadsheets) with a python data type called DataFrame. It allows us to wrangle column and row data without relying on SQL. Below are some examples of how we can apply column operations in DataFrames import pandas as pd inventory = pd.read_csv('inventory.csv') # integer location based indexing ... can be considered as l..
-
Python - unittest Frameworkpython 2022. 8. 8. 09:59
Python's unittest module provides us with a test runner. A test runner is a component that collects and executes tests and then provides results to the user. The framework also provides many other tools for test grouping, setup, teardown, skipping, and other features that we’ll soon learn about. The assertEqual() method takes two values as arguments and checks that they are equal. If they are no..
-
Web Dev Bootcamp TIL Day-64(Docker)카테고리 없음 2022. 7. 10. 13:06
Docker allows us to package the run-time environment of an application into an image A Docker image is a read-only template that defines your container. The image contains the code that will run including any definitions for any libraries and dependancies your code needs. A Docker container is an instantiated (running) Docker image. Docker enables an application to run in a variety of locations,..
-
[Algorithms] Bubble-Sort카테고리 없음 2022. 7. 2. 20:34
Bubble sort is an algorithm to sort a list through repeated swaps of adjacent elements. It has a quadratic runtime of O(n^2) since we are running (n-1) swaps n times. nums = [5, 2, 9, 1, 5, 6] def swap(arr, index_1, index_2): temp = arr[index_1] arr[index_1] = arr[index_2] arr[index_2] = temp def bubble_sort(arr): for el in arr: for i in range(len(arr)-1): if arr[i] > arr[i+1]: swap(arr, i, i+1)..
-
Web Dev Bootcamp TIL Day-56(Frontend / Backend Separation)카테고리 없음 2022. 7. 2. 16:07
When building a web application, it is often the case that a team of developers will separate the frontend and backend logic. The reasons for doing so are as follows: Modularity: the application can be developed at different paces. Resourcing / Expertise: choosing a front-end and back-end language may be in part a choice of resourcing; who can you hire to work on these things? What's the experti..
-
[Algorithms] Linear & Binary Search카테고리 없음 2022. 6. 29. 16:54
Linear Search The time complexity for linear search is O(N), but its performance is dependent on its input: Best Case: The algorithm requires only 1 comparison to find the target value in the first position of the list. Worst Case: The algorithm requires only n comparison to find the target value in the last position of the list or does not exist in the list. Average Case: The algorithm makes N/..
-
Web Dev Bootcamp TIL Day-51(Django ORM: Q() and _related)TIL 2022. 6. 25. 14:21
Django's built-in query object Q() allows us to query data in an equivalent manner to SQL WHERE clauses. from django.db.models import Q q = Q() q.add(Q(no=12121), q.OR) q.add(Q(name=lee)|Q(name=kim), q.AND) q.add(Q(142411), q.OR) Base.objects.filter(q) # equivalent to: # SELECT * FROM base WHERE (no=12121 AND (name='lee' OR name='kim')) OR no=142411 Q() comes in handy when we want to build lengt..
-
Web Dev Bootcamp TIL Day-50(DRF Serializers / Query Parameters)TIL 2022. 6. 24. 22:18
Query parameters are a defined set of parameters attached to the end of a url. They are extensions of the URL that are used to help define specific content or actions based on the data being passed. To append query params to the end of a URL, a ‘?’ Is added followed immediately by a query parameter. Let's say we want to search for jobs posts that require certain skills using query parameters: Fi..