merged pandas impl