Consider using rsplit('.', 2) so that datasets with dots in them will work.