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
string = '11100100’ | |
c = string[0] | |
lista = [] | |
lista.append(c) | |
for x in string[1:]: | |
if x == c: | |
lista.append(x) | |
else: | |
print(lista) | |
c = x |
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
#on yours computer | |
import pickle | |
from xgboost import XGBClassifier | |
from xgboost import Booster | |
clf = XGBClassifier() | |
booster = Booster() | |
booster.load_model('xgbsave_test.model') | |
clf._Booster = booster |
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 pickle | |
pkl_filename = "pickle_model.pkl" | |
#on server | |
with open(pkl_filename, 'rb') as file: | |
clf = pickle.load(file) |
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
from sklearn.model_selection import train_test_split | |
from xboost import XGBClassifier | |
X = #yours data | |
y = #labels | |
train_X, test_X, train_y, test_y = train_test_split(X, y, test_size=0.3, random_state=100) | |
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 requests | |
import pandas as pd | |
number_of_pages = 100 | |
#number_of_ads = number_of_pages * per_page | |
job_title = ["'Data Analyst' and 'data scientist'"] | |
for job in job_title: |
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
from collections import Counter | |
vacancy_names = df.name | |
cloud = Counter(vacancy_names) | |
from wordcloud import WordCloud, STOPWORDS | |
stopwords = set(STOPWORDS) | |
cloud = '' | |
for x in list(vacancy_names): | |
cloud+=x+' ' | |
wordcloud = WordCloud(width = 800, height = 800, |
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 ast # run code from string for example ast.literal_eval("1+1") | |
salaries = df.salary.dropna() # remove all NA's from dataframe | |
currencies = [ast.literal_eval(salaries.iloc[i])['currency'] for i in range(len(salaries))] | |
curr = set(currencies) #{'EUR', 'RUR', 'USD'} | |
#divide dataframe salararies by currency | |
rur = [ast.literal_eval(salaries.iloc[i]) for i in range(len(salaries)) if ast.literal_eval(salaries.iloc[i])['currency']=='RUR'] | |
eur = [ast.literal_eval(salaries.iloc[i]) for i in range(len(salaries)) if ast.literal_eval(salaries.iloc[i])['currency']=='EUR'] | |
usd = [ast.literal_eval(salaries.iloc[i]) for i in range(len(salaries)) if ast.literal_eval(salaries.iloc[i])['currency']=='USD'] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 numpy as np | |
import cv2 | |
import imutils | |
import os | |
import pytesseract | |
from PIL import Image | |
from pytesseract import image_to_string | |
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 numpy as np | |
def mean(data, x): | |
temp = data[::x] | |
return np.mean(temp) | |
OlderNewer