singhjagpreet's picture
data trasformation
bf0670d
raw
history blame
406 Bytes
import os
import sys
import numpy as np
import pandas as pd
import pickle
from src.exception import CustomException
def save_object(file_path, obj):
try:
dir_path = os.path.dirname(file_path)
os.makedirs(dir_path,exist_ok=True)
with open(file_path, 'wb') as file_obj:
pickle.dump(obj,file_obj)
except Exception as e:
raise CustomException(e,sys)