Computational Biology log
Programming
Python
general
Statistics
Pandas
Machine Learning
NetworkX
igraph
Visualization
Bash & HPC
Latex
Git
Julia
R
Other info
Data science notes
Work
Readings
Research life
Projects
About me / CV
Search
the best through menu creator from swimbi.com. All Rights Reserved
News
New paper!
Sunday, July 19, 2020
Element-wise operations of Arrays in Julia
How to compare elements in different arrays, and how to change elements based on the comparison
a = [1 2];
b = [10 -10];
a[a .> 1]
> [0 1] # [false true]
a[a .> 1] = 100;
# a is now [1 100]
b[a .> 1] = 0;
# b is now [10 100]
Newer Post
Older Post
Home