[PYTHON] 2. Make import easier

Do you write import every time you write a new script? Do you want to copy the previous code? The content is not difficult, but it takes time. import.jpg

Using pyforest makes writing imports easier. Example: Jupyter.gif You can use panda without importing anything.

Installation

(Requires Python 3.6 or higher)

pip install pyforest

How to use

from pyforest import *

You can use the registered library just by writing one line.

With Jupyter or IPython, pyforest adds itself to autostart, so you don't even need the above line.

Once the script is complete, you can see all the libraries that the script is involved with with the command below.

active_imports ()

The script shouldn't be heavy because it only imports the libraries used by the script.

New library added

pyforest supports mainstream data science libraries. For example, pandas, numpy, matplotlib, seaborn, sklearn, tensorflow, etc. (See pyforest / _imports.py for details)

When adding a new library, add a line to the user_specific_imports.py file.

user_specific_imports.py


TEMPLATE_TEXT = """# Add your imports here, line by line
# e.g
# import pandas as pd
# from pathlib import Path
# import re
"""

Table of contents IT memos for non-IT industries

Recommended Posts

2. Make import easier
Make C compilation a little easier
[Lambda] Make import requests available [python]
Make SikuliX's click function easier to use
Tips to make Python here-documents easier to read
About import
Make pypy submission easier with atcoder-cli (python)
About import