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
| SELECT | |
| d.domain, | |
| REPLACE(d.domain, CONCAT(SUBSTRING_INDEX(d.domain, '.', 1),'.'), '') as extensi_domain | |
| FROM tbldomains d |
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
| # open anaconda prompt | |
| # Change Directory ke folder terkait | |
| python -m main.py |
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
| # Cara 1 | |
| <img src="image/decisiontree.png"/> | |
| # Cara 2 | |
| from IPython import display | |
| display.Image("source.png") |
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
| $$Y=a_{0} + a_{1}X_{1} + a_{2}X_{2} + a_{3}X_{3} + a_{4}X_{4}$$ | |
| $$ dL/da_{0} = \frac{-2}{n} \sum(y-(a_{0} + a_{1}X_{1} + a_{2}X_{2} + a_{3}X_{3} + a_{4}X_{4} ))$$, | |
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 sklearn.preprocessing import LabelEncoder | |
| label_encoder = LabelEncoder() | |
| df['fruit_subtype_label'] = label_encoder.fit_transform(df['fruit_subtype']) | |
| df.head() |
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 StoreData(table_target,date_start,date_end,data,list_invoiceitem): | |
| sql_delete1 = "DELETE FROM "+str(table_target)+" WHERE DATE(date_invoice) BETWEEN DATE('"+str(date_start)+"') AND DATE('"+str(date_end)+"')" | |
| cursor1 = connWarehouseWhmcs.cursor() | |
| cursor1.execute(sql_delete1) | |
| connWarehouseWhmcs.commit() | |
| sql_delete2 = "DELETE FROM "+str(table_target)+" WHERE id_invoiceitem = %s " | |
| cursor2 = connWarehouseWhmcs.cursor() | |
| cursor2.executemany(sql_delete2,list(data['id'])) | |
| connWarehouseWhmcs.commit() |
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
| df = pd.read_table('../input/fruit_data_with_colors.txt') |
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 pymsql | |
| host = '192.189.191.111' | |
| port = '3306' | |
| user = 'admin' | |
| password = '123456' | |
| database = 'product' | |
| connProduct = pymysql.connect( | |
| host=host, |
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 sqlalchemy | |
| # Cara pertama | |
| conn_engine = 'mysql+pymysql://admin:123456@192.189.191.11:3306/product' | |
| df.to_sql( | |
| name='total_product', | |
| con=conn_engine, | |
| index = False, | |
| if_exists = 'replace' |
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
| <a href="arofiqimaulana.com" rel="noopener noreferrer" target="_blank">link</a> |
OlderNewer