This was resolved by ensuring the virtual environment was created using Python 3.11.6. Although I had installed the Python version and selected it as the python interpreter in vscode, it was not the interpreter used. I used the command pallet and selected Python: Create Environment instead.
The error was incompatibility between pandas and the python version