Course Name: Options Trading Strategies In Python: Intermediate, Section No: 2, Unit No: 3, Unit type: Notebook
The line options_data.append(monthly_data)
causes error.
Looks like append()
method has got deprecated, its alternative concat()
also is not available. What's the fix for it?
Hi Nikhil,
The append() method is deprecated, but you can use the concat() method as an alternative. Here's how you can use concat():
import pandas as pd
options_data = pd.concat([options_data, monthly_data])
This will concatenate monthly_data to options_data. If you encounter any issues, please feel free to reach out to us.
Thanks
Rushda
concat() doesn't work either. (I mentioned that in my post, but probably you missed that)
I am checking on latest versions - Python 3.12.2 and pandas-2.2.1.
The error is AttributeError: 'DataFrame' object has no attribute 'concat'.
Thanks Rushda for checking it and replying to the post.
Update: Found the fix. combine_first() works in this case.
That's great! If you need any further assistance you can drop a comment here 
Thanks
Rushda