All Articles

Concat DataFrame if not exists def merge_df(df_left, df_right): """ 두 데이터 프레임을 존재하는지 확인 후 합쳐서 새로운 데이터 프레임을 생성 및 리턴 Args: df_left (DataFrame): _description_ df_right (DataFrame): _description_ Returns: DataFrame: _description_ """ if df_right is None: # log('DataFrame df_right is null') if df_left is None: # log('DataFrame df_left is null') return None df_new = None if df_left is None: df_new = df_right else: df_new = pd.conca..
Shape Classcification from tensorflow.keras.applications.inception_resnet_v2 import InceptionResNetV2 from tensorflow.keras.applications.inception_resnet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.models import Model from tensorflow.keras.layers import Input from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import Dense f..
Keras image resize raw bytes with size > 코드, Numpy를 이용해서 resize def resize_image_from_bytes(pre_image, original_size: tuple, target_size: tuple): img = np.frombuffer(pre_image, dtype=np.float32).reshape(original_size + (3,)) img = image.array_to_img(img) return img.resize(target_size) > 결과화면
DataFrame to json utf8 한글 실패 jsonData = json.loads(df.to_json(orient="records")) with open("data.json", "w", encoding='utf8') as json_file: json.dump(jsonData, json_file, indent=4) with open("data.json", "w") as json_file: json.dump(jsonData, json_file, indent=4) 성공 pandas DataFrame to json file UTF-8 한글 df = pd.DataFrame() jsonData = json.loads(df.to_json(orient="records")) with open("data.json", "w", encoding=&..