Pythons

How to add a folder with Python packages to Anaconda path

To permanently include packages or folder into the PYTHONPATH of an Anaconda environment, activate the Conda environment and use [conda develop](https://docs.conda.io/projects/conda-build/en/latest/resources/commands/conda-develop.html) to add the path permanently to the PYTHONPATH of the Conda environment. conda develop /PATH/TO/YOUR/FOLDER/WITH/MODULES This command will create file named conda.pth file the site-packages folder of your environment. ~/anaconda3/envs/YOUR_ENV/lib/pythonX.X/site-packages As an alternative, you can just add a conda.pth file in ~/anaconda3/envs/YOUR_ENV/lib/pythonX.X/site-packages with the folder that you want to include in your PYTHONPATH.

How to Change the Line Length Character Limit in Black

To change the character limit for the Black Python formatter, you can add a file named [pyproject.toml](https://www.python.org/dev/peps/pep-0518/) with the following: [tool.black] line-length = 80 in your project directory. This change is permanent but will work only in the project with the mentioned file. As of July 2020, I haven’t found a way to make this change permanent globally to a Python environment

How to Slice Numpy Arrays?

How to Slice Numpy Arrays