From
http://developer.yahoo.com/weather/#reqQUOTE
Note: The old location parameter 'p' has been deprecated and will be removed in the future releases. Hence users are encouraged to migrate to the 'w' parameter which provides deep integration into Y! GeoPlanet. The old documentation is archived here.
So you will need to use woeid for the same.
-balaji