This file contains 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 base64 | |
import json | |
from google.oauth2.service_account import Credentials | |
from google.cloud.container_v1 import ClusterManagerClient | |
from kubernetes.client import ApiClient, CoreV1Api | |
from kubernetes.client.configuration import Configuration as KubernetesClientConfiguration | |
from tempfile import NamedTemporaryFile | |
class KubernetesApiClient: |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import six | |
import random | |
df = pd.DataFrame() | |
df['date'] = ['2016-04-{}'.format(day) for day in range(1, 51)] | |
df['calories'] = [random.randint(1500, 2000) for i in range(50)] |
This file contains 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 | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from scipy.spatial.distance import cosine | |
def get_best_n_match(external_products_df, internal_products_dfs, count=3): | |
# Create vectorizer according to internal product space | |
vectorizer = TfidfVectorizer() | |
vectorizer.fit(internal_products_dfs.name) |
This file contains 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
# Written by Mutlu Polatcan | |
# 09.07.2020 | |
# ============================================= | |
import requests | |
import re | |
from datetime import datetime, timedelta | |
class ShellOilTurkeyScraper: | |
URL = "https://www.turkiyeshell.com/pompatest/History.aspx" |