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 time | |
import requests | |
from bs4 import BeautifulSoup | |
from wordcloud import WordCloud | |
import matplotlib.pyplot as plt | |
def get_topics(url): | |
# 웹페이지를 읽어와서 | |
response = requests.get(url) | |
# Html 태그 구조를 이용해서 제목 값을 추출합니다. |
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 time | |
import numpy as np | |
from functools import reduce | |
def check_all_zero_list(xs_list): | |
for xs in xs_list: | |
for x in xs: | |
if x != 0: | |
return False | |
return True; |
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 tensorflow as tf | |
from tensorflow import keras | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from tensorflow.keras import layers | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Dense, LSTM, Dropout | |
data = np.loadtxt('NHN.csv',delimiter=' ', dtype=np.float) | |
data = data[::-1] #과거 자료가 앞으로 오도록 수정 |
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 os | |
import win32com.client | |
xl=win32com.client.Dispatch("Excel.Application") | |
xl.DisplayAlerts = False | |
for i in range(5): | |
wb = xl.Workbooks.Open(".....\\test.xlsx") | |
ws = wb.ActiveSheet | |
c = ws.Cells(1,1) |
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 io | |
import requests | |
import openpyxl | |
input_excel = requests.get("https://www.hira.or.kr/rd/hosp/hospSrchListAjax.do?pageIndex=1&pages=0&sidoCdNm=&sgguCdNm=&sortOrdr=&totalSrhYn=N&sno=1121&clCd=21&srchCd=&ykiho=&srchMode=general&isProfessional=N&isJongItem=N&isPharmacyItem=N&isPharmacy=N&isHouseholdMedicine=N&isPlcr=N&mode=&xPosWGS84=&yPosWGS84=&isDgsMap=&isEmyMap=&isNightMap=&isRecuMap=&isPlcrMap=&sidoCd=&sgguCd=&emdongNm=&yadmNm=%EB%B3%91%EC%9B%90%EB%AA%85+%EB%98%90%EB%8A%94+%EC%95%BD%EA%B5%AD%EB%AA%85%EC%9D%84+%EC%9E%85%EB%A0%A5%ED%95%98%EC%84%B8%EC%9A%94.&shwSbjtCd=23&shwSbjtCd=20&shwSbjtCd=01&shwSbjtCd=09&shwSbjtCd=17&shwSbjtCd=18&shwSbjtCd=15&shwSbjtCd=10&shwSbjtCd=08&shwSbjtCd=11&shwSbjtCd=02&shwSbjtCd=06&shwSbjtCd=12&shwSbjtCd=16&shwSbjtCd=26&shwSbjtCd=04&shwSbjtCd=24&shwSbjtCd=13&shwSbjtCd=21&shwSbjtCd=03&shwSbjtCd=05&shwSbjtCd=25&shwSbjtCd=19&shwSbjtCd=14&shwSbjtCd=22&shwSbjtCd=07&greenYn=&shwSbjtCds=23&shwSbjtCds=20&shwSbjtCds=01&shwSbjtCds=09&shwSbjtCds=17&shwSbjtCds=18&shwSbjtCds=15&shwSbjt |
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 math | |
import numpy as np | |
from shapely.geometry import LineString | |
ls = LineString([(0, 0), (50, -100)]) | |
xy = [] | |
for f in range(0, int(math.ceil(ls.length)) + 1): | |
p = ls.interpolate(f).coords[0] | |
if p not in xy: |
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 numpy as np | |
from sqlalchemy import create_engine | |
engine = create_engine('sqlite:///:memory:') | |
n=9999 | |
df = pd.DataFrame(np.random.randn(n, 2)) | |
df.columns = ['a','b'] | |
df = df.astype('float32') | |
df.to_sql('data_chunked', con=engine, chunksize=(499), index=None) |
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
from collections import OrderedDict, Counter | |
import pprint | |
def main(): | |
dict_data = { | |
'list_1':[1, 2, 3, 4, 5, 6], | |
'list_2':[1, 5, 6, 7, 8, 9], | |
'list_3':[10, 11, 12, 13, 14, 15], | |
'list_4':[132, 14, 134, 135, 136, 137], | |
'list_5':[232, 214, 224, 235, 236, 237], |
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 datetime as dt | |
today = dt.datetime.now() | |
days_in_the_year = (dt.date(today.year, today.month, today.day) - dt.date(today.year,1,1)).days + 1 | |
print(days_in_the_year) |
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 collections.abc | |
class CustomData(): | |
def __init__(self, iterable): | |
self.value = [] | |
for value in iterable: | |
self.value.append(value) | |
def __eq__(self, value): | |
ret = [] | |
for v in self.value: |
NewerOlder