Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set PYTHONHASHSEED for jupyter notebook?

I am trying to set PYTHONHASHSEED=0 to be able to reproduce my code. I know how to set it if using python filename.py, but I am using a .ipynb file. Is there any way I can set the PYTHONHASHSEED for my notebook?


1 Answers

%env PYTHONHASHSEED=0 or %env PYTHONHASHSEED 0 . (Use %env by itself to print out current environmental variables.)

https://ipython.readthedocs.io/en/stable/interactive/magics.html?highlight=magic#magic-env

like image 118
Sangram Gaikwad Avatar answered Apr 02 '26 14:04

Sangram Gaikwad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!