Output \n as a string in example code

Current output is:

$ echo "from numpy import random;" \
>      "n = random.randn(10000);"  \
>      "print('\n'.join(str(i) for i in n))"
from numpy import random; n = random.randn(10000); print('
'.join(str(i) for i in n))

After this change, I think it is originally expected string:

$ echo "from numpy import random;" \
>      "n = random.randn(10000);"  \
>      "print('\\\n'.join(str(i) for i in n))"
from numpy import random; n = random.randn(10000); print('\n'.join(str(i) for i in n))
This commit is contained in:
284km 2020-11-04 12:16:28 +09:00 committed by kojix2
parent 99e9e28ec9
commit 93f8efc60a

View File

@ -31,7 +31,7 @@ ruby -r numo/narray -e "puts Numo::DFloat.new(1000).rand_norm.to_a" \
```sh
echo "from numpy import random;" \
"n = random.randn(10000);" \
"print('\n'.join(str(i) for i in n))" \
"print('\\\n'.join(str(i) for i in n))" \
| python \
| uplot hist --nbins 20
```