The Question:

What Shakespeare play is this quote from?

"There's rosemary, that's for remembrance; pray,love, remember: and there is pansies. That's for thoughts."

The Answer:

This is from Hamlet, act IV, scene 5. Ophelia has fallen into madness after the death of her father. She sings these lines in front of Gertrude and Claudius, who are agitated by Ophelia's state of mind.

—The Fact Monster