A quick and dirty way would be:
$ nix run "(import <nixpkgs> {}).python37.withPackages([ pandas statsmodels ])"
This would drop you into a shell with Python 3.7, pandas, and statsmodels installed.
For more complex use cases, you should specify your dependencies in a shell.nix file or write your own nix package.