title: Set default Pandas options at Startup in PyCharm
body: <p>Looking to create my Pandas startup options for any project in Pycharm. I have a project called Test which has three modules.</p>
  <p>I created <code>Startup_Panda_Options.py</code> with the settings I require, then created <code>__init__.py</code> so it would be loaded when Test project starts up. When I run on some test data, in <code>test.py</code> it fails as I'm getting <code>NameError: name 'pd' is not defined</code> which implies <code>__init__.py</code> never ran.</p>
  <p>The second option was placing Startup_Panda_Options.py into folder <code>C:\Users\peter\Documents\PyCharm\venv\Lib\site-packages\IPython\core\profile</code> but the same issue arises.</p>
  <p>Third option, in PyCharm via File | Settings | Tools | Startup Tasks | I referenced the <code>Startup_Panda_Options.py</code> file.</p>
  <p>So three attempts based on suggestions from here and the documentation. Any ideas on how to get any of these options working?
  The three modules are below:</p>
  <pre class="lang-py prettyprint-override"><code>Startup_Panda_Options.py:
  
  import pandas as pd
  
  def Panda_Options():
          options = {
              'display': {
                  'max_columns': None,     # used in __repr__() methods ‘None’ value means unlimited.
                  'max_colwidth': 25,     # sets the maximum width of columns. Cells of this length or longer will be truncated with an ellipsis.
                  'expand_frame_repr': False, # Don't wrap to multiple pages
                  'max_rows': None,      # This sets the maximum number of rows pandas should output: ‘None’ value means unlimited.
                  'max_seq_items': 50,     # Max length of printed sequence
                  'precision': 4,       # sets the output display precision in terms of decimal places.
                  'show_dimensions': False   # Whether to print out dimensions at the end of DataFrame repr. If ‘truncate’ is specified, only print out the dimensions if the frame is truncated (e.g. not display all rows and/or columns)
              },
              'mode': {
                  'chained_assignment': None  # Controls SettingWithCopyWarning: ‘raise’, ‘warn’, or None. Raise an exception, warn, or no action if trying to use chained assignment i.e. If try to change the value of a copy of the datafrrame as opposed to the dataframe itself
              }
          }
  
          # Loop through dictionaries
          for category, option in options.items():
              # Inside the nested dictionaries
              for op, value in option.items():
                  # Set Pandas options usinf f strings
                  pd.set_option(f'{category}.{op}', value)
  
  if __name__ == '__main__':
      Panda_Options()
      del Panda_Options # Clean up namespace in the interpreter
  
  __init__.py:
  Import Startup_Panda_Options.Panda_Options
  
  test.py:      
  def main():
      url = ('https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data')
      cols = ['sex', 'length', 'diam', 'height', 'weight', 'rings']
      abalone = pd.read_csv(url, usecols=[0, 1, 2, 3, 4, 8], names=cols)
      print(abalone)
  
  if __name__ == &quot;__main__&quot;:
      main()
  </code></pre>