put down to

put (something) down to (something else)

1. To regard a situation, action, or outcome as being the result of some specific aspect, condition, or event. The runner put her leg pain down to simple muscle fatigue, but she was shocked to learn that it was due to deep vein thrombosis. I put most of my success down to the excellent education I received in college.
2. To regard a situation, action, or outcome, especially a negative one, as a means of gaining something positive. I know you're upset about failing your exam, but just put it down to experience and study harder next time. I doubt I'll get my money back for this broken computer. I guess I'll just put it down to learning the hard way to be more careful when I buy used products.
See also: down, put, to
Farlex Dictionary of Idioms. © 2015 Farlex, Inc, all rights reserved.

put something down to something

 and set something down to something
to explain something as being caused by something else. I put his bad humor down to his illness. We set your failure down to your emotional upset.
See also: down, put, to
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs. © 2002 by The McGraw-Hill Companies, Inc.
See also:
References in classic literature ?
A poem of the satirical kind cannot indeed be put down to any author earlier than Homer; though many such writers probably there were.
Due to the severe injuries the creamy brown-coloured animal sustained, the RSPCA said it was put down to end its "unbearable suffering".
Our house is now much admired by our friends, a fact that my wife puts down to its stylishness, and that I put down to their politeness - Harry Enfield.I practised 26 hours a week and ultimately achieved the status of a decent seven-year-old - Actor Russell Crowe who had to learn the violin for a new film part.
Two horses weren't killed, they were put down to save them from further suffering.