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 streamlit as st | |
import pymysql | |
from sqlalchemy import create_engine | |
st.sidebar.header('User Input Parameters') | |
date = pd.datetime.today() | |
server = st.sidebar.text_input('Server 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
import zipfile | |
import tempfile | |
stream = st.file_uploader('TF.Keras model file (.h5py.zip)', type='zip') | |
if stream is not None: | |
myzipfile = zipfile.ZipFile(stream) | |
with tempfile.TemporaryDirectory() as tmp_dir: | |
myzipfile.extractall(tmp_dir) | |
root_folder = myzipfile.namelist()[0] # e.g. "model.h5py" | |
model_dir = os.path.join(tmp_dir, root_folder) |
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
# in a given folder read all json files and map the columns in a dataframe | |
import pandas as pd | |
import os, json | |
import glob | |
import numpy as np | |
def read_path(path): | |
folder_name = path | |
all_files = glob.glob(path + "/*.json") |
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 os | |
import glob | |
import io | |
import xml.etree.ElementTree as ET | |
def read_path(path): | |
folder_name=path | |
all_files = glob.glob(path + "/*.xml") | |
files=[] |