This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE UPLOAD ON COMMENT FIELD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Membagi 'a' menjadi 'b' bagian | |
a = [1,2,3,4,5,6,7,8,9,10,11] | |
b = 3 | |
new_arr = [] | |
for i in range(b): | |
if i == 0: | |
new_arr.append(a[:(i+1)*(int(np.ceil(len(a)/b)))]) | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import re | |
import string | |
from tqdm import tqdm | |
from Sastrawi.Stemmer.StemmerFactory import StemmerFactory | |
class DataCleaning: | |
# Initialization | |
factory = StemmerFactory() | |
stemmer = factory.create_stemmer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def kFold(list, totalFold): | |
# Pre-requisite check | |
if totalFold > len(list): | |
raise Exception("TotalFold can't be more than total element in the list") | |
# Variable initialization | |
fold = [] | |
current_element = 0 | |
element_per_fold = len(list) // totalFold | |
modulus_counter = len(list) % totalFold |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- All about Kubernetes - | |
You need to install docker, kubernete or minikube(only runs on local), and kubectl | |
Node is a machine (it can be a baremetal computer or a VM) | |
Pod is a container that contain a "docker container" | |
Creating pods | |
$ kubectl create -f [yaml file] | |
See running pods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- All about Docker - | |
Installing Docker on Ubuntu | |
https://docs.docker.com/engine/install/ubuntu/ | |
How to deploy a docker container with interactive bash? | |
$ docker run -d -t --hostname [Nama Hostnya / PCnya] --name [Name of the container] [docker container] | |
How to see deployed container? | |
$ docker container ls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quicksort(lst, sort='asc'): | |
#Use 'asc' for ascending sort | |
#Use 'dsc' for descending sort | |
if (len(lst) == 1): | |
return lst | |
elif (len(lst) == 2): | |
if sort == 'asc': | |
if lst[0] >lst[1]: | |
lst[0], lst[1] = lst[1], lst[0] | |
return lst |
NewerOlder