Bash, how to calculate total from loop output

Please assist on that matter, I am trying to get a total number from loop that outputs 4 numbers as shown below: #!/bin/bash Bank=4 for ((out=1; out<=$Bank; out++)) do echo $out done I am getting output that looks like that: 1 2 3 4 How can I calculate 1+2+3+4 and get that calculated output 10… Read More Bash, how to calculate total from loop output

looping in a Data frame

I’m pretty new in R and I would like to know why this operation doesn’t allow me to keep looping through a data frame. I have a dataframe filled with the following data (take note that it only has one column): 1,230.1,37.8,69.2,22.1 <– this is treated as a column like "1,230.1,37.8,69.2,22.1" 2,44.5,39.3,45.1,10.4 3,17.2,45.9,69.3,9.3 4,151.5,41.3,58.5,18.5 5,180.8,10.8,58.4,12.9… Read More looping in a Data frame

Is there a way to turn this into a loop?

Is there a way to turn this into a loop, where the city names (berlin, munich, hamburg, cologne) are looped in the calculations as well as in the print? If so, how do i do it? max_b = airquality_berlin[‘NO2’].max() min_b = airquality_berlin[‘NO2’].min() print(f"The inter-annual range of NO2-concentration in Berlin is: {max_b-min_b}\n") max_b = airquality_munich[‘NO2’].max() min_b… Read More Is there a way to turn this into a loop?