While both are Pontiac Grand Prix, the specific components and procedures for replacing front wheel bearings might differ slightly between a 1997 and a 2001 model year. The designs *could* be very similar, but there's no guarantee. Minor changes in suspension geometry or bearing design could impact the process.
To be certain, you should consult a repair manual specific to each year. A Haynes or Chilton manual for each year would provide the most accurate information and step-by-step instructions. Relying on a guide for one year to work on the other could lead to difficulties or even damage.