if input is pandas, output will be pandas