This error is raised by pandas and doesn’t seem to be PyTorch-specific, so I would recommend to use a pandas support board or e.g. StackOverflow to get a faster and better answer.
Based on the error message I’m not sure which method raises the error, i.e. where pandas/core/algorithms.py is used.
PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier.