Storing US Options data


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 files

D:\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'

Hi Pierre,



I downloaded the notebook from the course and was able to run it without encountering any errors. The notebook appears to be functioning smoothly for me. I am currently using the quantra environment, which has pandas version 1.4.4.



To verify the pandas version on your system, you can execute the following command:

print(pd.version)



A​​​​​​and in case it is not 1.4.4. you can upgrade it to this version using the following command:

pip install --upgrade pandas==1.4.4



Hope this helps in resolving the error!



Thanks

Rushda