title: What is the difference between "import package" versus "from package import ..."?
body: <p>Why are some packages such as Pandas always imported as:</p>
  
  <pre><code>import &lt;name of package&gt; #e.g. import pandas as pd
  </code></pre>
  
  <p>While other packages are "imported" as:</p>
  
  <pre><code>from &lt;name of package&gt; import &lt;module&gt; #e.g. from fredapi import Fred
  </code></pre>
  
  <p>I understand that when you want to import packages that have a lot of modules, you can import a specific module you need with </p>
  
  <pre><code>from &lt;name of package&gt; import &lt;module&gt; #e.g. from fredapi import Fred
  </code></pre>
  
  <p>versus importing the entire package and all it's modules.</p>
  
  <p>My question is more about the packages that are only able to imported with: </p>
  
  <pre><code>from &lt;name of package&gt; import &lt;module&gt; #e.g. from fredapi import Fred
  </code></pre>
  
  <p>Is it because of the structure of the package? Is it because it's not actually a package? I'm confusing myself at this point. Hope someone could shed some light on this. </p>
  
  <p>A concrete example, I can never import fredapi like this:</p>
  
  <pre><code>import fredapi
  </code></pre>
  
  <p>I can only use fredapi with the "from" command. </p>
  
  <pre><code>from fredapi import Fred
  </code></pre>