The code in this repository is modified after scipython.com. It plots Earth's dipolar magnetic field and was used in the blog post on Earth's dipolar magnetic field. For further details, please refer to this post.
For reproducibility:
conda create -n magneticfield -y python=3.7
conda activate magneticfield
conda install -y numpy matplotlib scikit-learn