Fix apply on empty DataFrame returns DataFrame