My dd did this and she is 2 now and this kind of behaviour has lessened. It is a mix of frustration and attention seeking. Best just walk away and ignore it when it happens. Don't look at her or react in any way. She is trying to get a reaction. Usually they stop before they hurt themselves too much. Hate to say it but it is a phase they all have their quirky ways
our daughter did the same thing for about 6months. We just ignored and continued our conversation or left the room. No reaction is they key i think. Unfortunatley if we had relatives present they would often react and encourage the behaviour. Our daughter then stoppped doing this and all is well.
Thanks for the help. I am trying to ignore it the best I can,it's hard though especially when she does things like hit her face on her stroller so hard her mouth starts to bleed. It's nice to know I'm not alone.