If you mean sympathy, empathy, practical compassion, perhaps the suttas linked below are relevant.
I suspect trying to find the concept of “taking another’s perspective” might get confused with the idea of adopting another’s View, which is not (I think) exactly relevant.
The suttas are full of references about considering the welfare of others; it’s difficult (is it even possible?) to understand another’s welfare or concerns, and to speak appropriately to them in their particular condition, without some insight into how they might see it.
So - Perhaps this?
https://suttacentral.net/sn10.2/en/sujato
“No matter what the apparent reason
why people are together, Sakka,
it’s unworthy for a wise person
to not think of the other with compassion.
If you instruct others
with a mind clear and confident,
your compassion and empathy
don’t create attachments.”
And then there’s this, perhaps?
https://suttacentral.net/mn62/en/horner#bd21
Develop the (mind-) development that is friendliness, Rāhula. For, from developing the (mind-) development that is friendliness, Rāhula, that which is malevolence will be got rid of.
Develop the (mind-) development that is compassion, Rāhula. For, from developing the (mind-) development that is compassion, Rāhula, that which is harming will be got rid of.
Develop the (mind-) development that is sympathetic joy, Rāhula. For, from developing the (mind-) development that is sympathetic joy, Rāhula, that which is dislike will be got rid of.
Develop the (mind-) development that is equanimity, Rāhula. For, from developing the (mind-) development that is equanimity, Rāhula, that which is sensory reaction will be got rid of.
or Bhante S’s translation (but the words might be scarier?)
https://suttacentral.net/mn62/en/sujato#18
Meditate on love. For when you meditate on love any ill will will be given up.
Meditate on compassion. For when you meditate on compassion any cruelty will be given up.
Meditate on rejoicing. For when you meditate on rejoicing any negativity will be given up. Meditate on equanimity.
For when you meditate on equanimity any repulsion will be given up.
Nice topic, I look forward to reading other (probably more erudite) responses.