Python equivalent of R's head and tail function Python equivalent of R's head and tail function r r