Gosh! With one so young, this is really a tough call. Is she mature enough to have a give-and-take conversation (on her level of course)? If so, try to talk to her about it; ask her why she does these things. In all likelihood it is just her expression of frustration over something and she doesn't really understand it herself. Let her know that, when she does things to hurt herself, it makes Mommy sad and ask her to come to you instead when she wants to do something like that (hitting/biting herself, etc.) At 17 months, you may have to offer a lot of probative questions to get to the root of her behavior. "Are you mad when you do that?" "Why are you mad? What makes you mad?" "Do you want to hurt Mommy's little girl?" etc.
There could be an emotional issue that you would want to talk to a doctor about. Both slower developing as well as children far above the learning curve become frustrated at such a young age at their inability to convey their thoughts or emotions. This often manifests itself in self-distructive behavior. (When they get older, unfortunately, it is the highly intelligent ones who tend to have the greatest adaptive problems.) So you might want to discuss this with your pediatrician.
In all likelihood, however, this is something she will grow out of, though it may take a year or more to do so. But she will need guidance from you to help her understand her feelings and find different ways of expressing herself.
Just remember, the two keys to good parenting are love and patience.
Good luck.
Addendum: Kathy S.'s response is dead on as far as the immediate response to a tantrum. If you are out in public and she begins this behavior take your shopping to the service desk, let them know you will be back for it, leave the store and go home. No conversation. No argument. No recrimination.