title: How can I write a python class in a jupyter notebook and then import it to use again?
body: <p>I'm really new at this and struggling some. 
  I have written a class that has several methods that do some basic calculations. I've written it in jupyter notebook, and save it as a BaseModel.ipynb file. the code all works when i use it in the same notebook. </p>
  
  <p>i want to be able to import the class when working in a fresh jupyter notebook to keep things less cluttered as the class is fairly long, and thought i would be able to save it as an .ipynb or .py and then in new notebook do import BaseModel but then i get the error</p>
  
  <p>ModuleNotFoundError                       Traceback (most recent call last)
   in 
  ----> 1 import BaseModel</p>
  
  <p>ModuleNotFoundError: No module named 'BaseModel'</p>
  
  <p>I've tried to search here and see responses about adding an empty notebook called '<strong>init</strong>.py but doesn't work. I've watched videos but can't get it to do anything. </p>
  
  <p>Thanks in advance, and struggling here! I've done a bunch of courses that show you how to do basic data analysis in notebooks and its great, but finding learning about classes and how they interact with notebooks and import is losing me, any resources/courses to view would be appreicated too.</p>
  
  <p>Thanks very much</p>