If you want 100% accuracy from these kinds of tasks with LLMs you can get it today, but you need to provide the LLM with the ability to run Python code and tell it to use something like Pandas.

You can confirm it's doing the right thing by reviewing the code it wrote.

Or you can just write the code to do it correctly. Which would be quicker. If you can review it properly you already understand how to do it.

That would require me to have memorized the pandas API.

I've been using pandas on-and-off for over a decade and I still haven't come close to doing that.