I am running this on my local machine:
# Loop for extracting the zip files
for zipfile_ in dir_list:
with py7zr.SevenZipFile(path+zipfile_, 'r') as archive:
archive.extractall()
all_files = archive.getnames()
# Read the files and store the necessary data in a dataframe
for file_name in all_files:
monthly_data = pd.read_csv(file_name, sep=',')
# Move the files to the master dataframe
options_data = options_data.append(monthly_data)
# Delete the extracted files
os.remove(file_name)
Getting Attribute Error:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_31676\3744446669.py in ?() 8 # Read the files and store the necessary data in a dataframe 9 for file_name in all_files: 10 monthly_data = pd.read_csv(file_name, sep=',') 11 ---> 12 # Move the files to the master dataframe 13 options_data = options_data.append(monthly_data) 14 15 # Delete the extracted filesD:\Anaconda\envs\quantra_py\lib\site-packages\pandas\core\generic.py in ?(self, name)
6200 and name not in self._accessors
6201 and self._info_axis._can_hold_identifiers_and_holds_name(name)
6202 ):
6203 return self[name]
-> 6204 return object.getattribute(self, name)AttributeError: 'DataFrame' object has no attribute 'append'