python requests lib is not working in amazon aws

You get different IP after ping because www.nseindia.com is delivered to you through akamai CDN. So you are pinging different edge location whether you are doing this from home/work or AWS servers.

What's more, IP address ranges of AWS are publicly known. Thus, its not uncommon for websites to explicitly block AWS connections, to protect from scraping, attacks or otherwise unwanted access. Thus it seems that nseindia is blocking all these AWS IP addresses. It is a known issue as indicated here and here for examples.

The solution is not to use AWS nor other popular could providers (nseindia also blocks others). You could try to proxy your AWS requests through some commercial VPN maybe, home/work network, or something that is not blacklisted. Sadly, this is try-and-see approach. But you have to also consider potential legal/ethical issues of bypassing these restrictions.