Last active
February 15, 2020 19:35
-
-
Save aldro61/c70fac1b4405be8c75ffdf3d274fa0b4 to your computer and use it in GitHub Desktop.
A bash function to generate a logspace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a logspace from numpy in bash | |
# Usage: logspace start end [count, default=10] | |
# Just source this file or add it to your .bashrc | |
logspace () { | |
start=$1 | |
end=$2 | |
if [ $# -ne 3 ] | |
then | |
count=10 | |
else | |
count=$3 | |
fi | |
python -c "import numpy as np; print(np.logspace($start, $end, $count).tolist())" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment