How to efficiently remove content of frame in Tkinter Python?

I have built a code that saves the calculated data at every iteration in a for loop and the results are stored in a csv file. The saved results are read in another python code that displays the results using GUI tkinter on a window containing a frame. The frames is updated automatically every 3 seconds perfectly in a while loop.

I added a "close" button on the frame that when pressed should DESTROY/CLOSE the specific frame. When I press the close button, the respective frame is immediately closed. However, now when I have closed the frame, when I press the button that is supposed to show the frame again, the frame is NOT opening again. It is giving me an error:

_tkinter.TclError: bad window path name ".!labelframe"

If I don't press the close button, this problem does not happen. Hence, the problem is definitely from destroying and closing the frames.

I have attached my edited code here:

import random
from tkinter import*
import tkinter as tk
import numpy as np

base = tk.Tk()

frame1 = tk.LabelFrame(base, text="MVs ", width=240, height=330, bd=15)
frame1.grid(row=1, column=0,  padx=8)


def MVs():
    #read files from saved excel sheets

    global c
    global frame1

    if z[c]==1:

        frame1 = tk.LabelFrame(base, text="MVs", width=240, height=330, bd=15)

        frame1.grid(row=1, column=0,  padx=8)



    def exit_btn():
        global z

    Label(frame1,text="Tc Measured").grid(column=0,columnspan=1,row=2,rowspan=1, sticky=W)
    Label(frame1,text="Tc Optimum").grid(column=0,columnspan=1,row=3,rowspan=1, sticky=W)
    Label(frame1,text="Tc Cost").grid(column=0,columnspan=1,row=4,rowspan=1, sticky=W)
    Label(frame1,text="Tc Weight").grid(column=0,columnspan=1,row=5,rowspan=1, sticky=W)

    Label(frame1,text="Q Measured").grid(column=0,columnspan=1,row=6,rowspan=1, sticky=W)
    Label(frame1,text="Q Optimum").grid(column=0,columnspan=1,row=7,rowspan=1, sticky=W)
    Label(frame1,text="Q Cost").grid(column=0,columnspan=1,row=8,rowspan=1, sticky=W)
    Label(frame1,text="Q Weight").grid(column=0,columnspan=1,row=9,rowspan=1, sticky=W)

    for i in range(8):
        Label(frame1,text= str(round(MV[i,0],5))).grid(column=1 ,columnspan=1,row=i+2,rowspan=1, sticky=W)





frame1.after(0, MVs)