For the most part, I would say YES! Pansies tend to be a great windowbox plant. Of course, not every windowbox is alike. In short, if you have a sheltered windowbox, pansies make an excellent cool-weather windowbox tenant.
Here are three things to keep in mind about windowboxes:
Windowboxes often offer protection from the elements. Frost, harsh mid-day sun, hail or hard freeze are less of a problem because windowboxes are often sheltered by a building’s overhang or eves. (Pansies have delicate foliage and flowers and appreciate being sheltered from the elements.)
Small containers dry out quickly. Windowboxes are often shallow containers, so soil can dry out quickly and won’t accommodate plants with deep or extensive root systems. Choose plants that can withstand dry soil and have shallow roots. (Pansies have shallow roots, and they’re relatively forgiving if you forget to water them for a day or two.)
Some windowboxes don’t have drain holes, so notice if yours has them when you’re getting ready to plant. Drill bottom holes or be careful not to over-water. (Pansies will tolerate “damp feet” but you should still be careful not drown them or root rot, mildew and mites can become a problem.)
Here in the Northern US, pansies are a great windowbox plant for the early part of the year, no matter what exposure they get. And if you’re still not sure they’d work for your windowbox, they’re an inexpensive plant to experiment with.