DOC: python 3 compatibility in code examples
Some changes to our code examples needed to make them all run with python 3.

(there are still problems with our accessor extensions to have doc building on py3 fully working)
## [Current coverage](https://codecov.io/gh/pandas-dev/pandas/pull/15011?src=pr) is 84.78% (diff: 100%)
> Merging [#15011](https://codecov.io/gh/pandas-dev/pandas/pull/15011?src=pr) into [master](https://codecov.io/gh/pandas-dev/pandas/branch/master?src=pr) will not change coverage

```diff
@@             master     #15011   diff @@
==========================================
  Files           145        145          
  Lines         51090      51090          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43315      43315          
  Misses         7775       7775          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [e27b296...5583c98](https://codecov.io/gh/pandas-dev/pandas/compare/e27b29697f0dcf9359f01a19edb2f20c6d728b6c...5583c983f0811fe91af97e5389c51b3ac2f49546?src=pr)