The visitors won by 168 runs to take a 4-0 lead in the series.
"Middle order is where I bat. Starting from no.4 to no.6 I have batted at different positions for India. I have to be ready for whatever spot I get. So if I get a chance then I need to get some runs and cement that spot for myself first," Pandey said at the post-match press conference last night.
Pandey's unbeaten knock came off 42 balls, and was studded with four boundaries.
"Even batting through the India-A series, I batted very similar to the way I batted today. So it was not too different for me to come back and think about it like it was my first game in a long time. I have been batting well in the nets and I just had to watch the ball and play," he added.
More From This Section
"The start was really important for us. I think we did well given the fact that it was really hot. The guys were batting very well and were looking for boundaries.
"The way Virat and Rohit batted, getting their hundreds, I thought it allowed us to come back in the middle overs (after the collapse) and look for boundaries. It was a little easier for us in the end," Pandey said.
India lost their way after both Kohli and Sharma got out. They lost four wickets for 49 runs, but batting in his 300th ODI, Dhoni helped guide the finishing overs with Pandey. In the afternoon, Kohli had gifted Dhoni a platinum bat-memento to mark the occasion.
"I have played a few games with him already. I know how he plays. I know how he likes to rotate strike. I like to bat with somebody who loves to do that. Occasionally we get some fours and that's how we keep the scoreboard ticking. With Mahi bhai, you are always on your toes and he keeps giving you advice," he added.
"Rahul is used to batting in the top order and the game is a little different there. It is on him to come out of this situation again. Perhaps he has to understand how the middle overs go because he always opens the batting and suddenly you are batting after 30 overs, you need some time.
"Maybe as he plays more matches batting in the middle order, he will get used to it. Even I was found it difficult when I was batting at no.6, because I was coming after 40 overs and I was used to batting at no.4 when batting comes after 25 overs.
Pandey came into the side on back of experimentation by the team management keeping in view the 2019 World Cup. Kedar Jadhav was left out, and Pandey responded with a well-made half-century to his credit, carrying the form over from the India-A tour of South Africa.
"I had a chat with Ravi Bhai yesterday and even today before the start of the game about how I take some time before I start playing my natural game. So that's what my plan was. I got my batting after the 35th over where again one wicket fell and me and Mahi bhai were there.
"I was also waiting for this chance and I am glad that I got it now. I have to try and use these chances as much as possible to help myself become a permanent member of this team and win games for India," Pandey said.
He said the tour of South Africa helped him a lot.
"As I said I have played some games in South Africa and I have to bat the way I have been batting. Definitely, it does really help a lot when you know that you have some runs in the back. Then you will eventually get a chance in the ODI side.