Question: I have monthly data and I want to plot only certain regions, every 24 steps (2 years) or so, how can I find a quick way to plot every 20 steps using a for loop maybe?
For example, instead of doing this:

```
#first 24 indices
plt.plot(time_months[0:24], monthly[0:24])
plt.xticks(rotation=35)
plt.show()

#next set of 24 indices
plt.plot(time_months[24:48], monthly[24:48])
plt.xticks(rotation=35)
plt.show()

```

I tried this:

```
for i in range(monthly.size):
    plt.plot(time_months[0:i,24])
plt.show()

```

but I get an error:

```
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-11-db04910853f1> in <module>
      4 
      5 for i in range(monthly.size):
----> 6     plt.plot(time_months[0:24,i])
      7 plt.show()

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

```

Answer: 
`pipenv` has no special option for it. But you can use these bash scripts (I made them using the venvs directory `~/.local/share/virtualenvs/` so you should change it if your venvs folder is different)

PRINT useless venvs:
====================

```
for f in $(find ~/.local/share/virtualenvs/*/.project -type f); do proj_path="$(cat $f)"  && [ ! -d "$proj_path" ] && echo ${f//\/.project};  done;

```

**PRINT not existing projects paths** that still have corresponding venvs:

```
for f in $(find ~/.local/share/virtualenvs/*/.project -type f); do proj_path="$(cat $f)"  && [ ! -d "$proj_path" ] && echo $proj_path;  done;

```

**PRINT both** (useless venvs and not existing project folders):

```
for f in $(find ~/.local/share/virtualenvs/*/.project -type f); do proj_path="$(cat $f)" && [ ! -d "$proj_path" ] && echo $proj_path "\n"${f//\/.project} "\n";  done;

```

DELETE useless venvs
====================

```
for f in $(find ~/.local/share/virtualenvs/*/.project -type f); do proj_path="$(cat $f)" && [ ! -d "$proj_path" ] && rm -rif ${f//\/.project} && echo DELETING ${f//\/.project};  done;

```

Try printing the venvs before deleting!

p.s. If your venv folder is not `~/.local/share/virtualenvs/`, make sure to change it to your venv path!
Here is a bash script to check and clean up abandoned pipenv environments interactively based on the [answer of @yestema](https://stackoverflow.com/a/67209898/12361118).

```sh
#!/usr/bin/env bash

# Author: TiDu Nguyen
# https://gist.github.com/tidunguyen/0fc018326f33c29e819be7f388360a5b

# get all pipenv environments
allPipenvEnv=$(find ~/.local/share/virtualenvs/*/.project -type f)

# find abandoned environments
abandonedEnv=()
for f in $allPipenvEnv; do
    proj_path="$(cat $f)" && [ ! -d $proj_path ] && abandonedEnv+=($proj_path)
done

# if there is any abandoned environment, prompt for cleaning, else, exit
if [ ${#abandonedEnv[@]} -eq 0 ]; then
    echo "No abandoned environment, hooray"
else
    echo "Found ${#abandonedEnv[@]} abandoned pipenv environment(s):"
    for value in "${abandonedEnv[@]}"; do
        echo $value
    done

    echo -e "\nClean up abandoned pipenv environments?"
    select choice in "Yes" "No"; do
        case $choice in
        Yes)
            for f in $allPipenvEnv; do
                proj_path="$(cat $f)" && [ ! -d $proj_path ] && rm -rif ${f//\/.project/} && echo DELETING ${f//\/.project/}
            done
            echo "Done!"
            break
            ;;
        No)
            break
            ;;
        esac
    done
fi

```