'Casting a MM:SS string into a double

My first stackoverflow question!

I am sure this answer must be buried somewhere in here, but I was unable to find it after about 90 mins of searching (gotta up my search game, for sure).

Anyways, I have a simple Kaggle dataset of NBA games with a column of MIN for minutes played. And the format of this column is MM:SS in a string type. What I am looking to do is to cast this into a double, but I am unable to do so as it returns NULL.

Any idea how I could get this done? So far I have only found threads for date timestamps type questions, but I only want one decimal value, be it the minute (I am thinking some sort of slicing here), or even better, a more accurate decimal (like if the entry is 13:30, the return if 13.5).

Any help would be great!

Thanks in advance,

J.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source