moved pandas import to top level so it is only executed once (quite slow for some reason)