- Install xcode: $ xcode-select --install
- Install homebrew: $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Create .bash_profile: $ touch ~/.bash_profile
- Put this line inside .bash_profile: export PATH=/usr/local/bin:$PATH
- Install python3: $ brew install python3
- Create virtual environment. To make it easily found, create it under home: $ cd ~ && pyvenv arwan
- Activate the virtual environment created: $ source arwan/bin/activate
- Now you can start working in the new virtual environment. Note that it is worth to look at requirements.txt to see required packages on certain projects.
IF Condition in Wolfram Mathematica The syntax is as follows xxxxxxxxxx If [ condition , what to do if true , what to do if false ] Some examples Example 1. Simple command x x = - 3 ; If [ x < 0 , - x , x ] 3 Example 2. If condition in a function abs [ x_ ] := If [ x < 0 , - x , x ] abs /@ { - 3 , 2 , 0 , - 2 } { 3 , 2 , 0 , 2 } For in Wolfram Mathematica The syntax is as follows For [ start , test , inc , what to do ] Some examples Example 1. Simple Loop xxxxxxxxxx For [ i = 0 , i < 4 , i ++, Print [ i ]] 0 1 2 3 Example 2. Another simple loop For [ i = 10 , i > 0 , i --, Print [ i ]] 10 9 8 7 6 5 4 3 2 1 Example 3. Print list a = { 10 , 3 , 9 , 2 } For [ i = 1 , i < 5 , i ++, Print [ a [[ i ]]]] 10 3 9 2
Comments