copy().astype(int) can be replaced by astype(int) alone: it already make a copy.