Posts

Showing posts from March 16, 2019

Apply Max to each element of a list

Image
1 I have a list a = {1, 8, 0, 6, 5, 3, 5, 2, 2, 5} I want to generate a new list whose elements are the same of a if it's bigger than 5, or 5 elsewhere. I managed to achieve this using Map and a pure function doing Map[(Max[#, 5]) &, a] but this looks a bit clumsy to me. Is there a better way? EDIT: I found this solution a /. x_ /; x < 5 -> 5 but I cannot really understand why is working. Could someone give an insight into it? Thanks map share | improve this question edited 2 hours ago asked 2 hour...

Bernisse

Image
Former municipality in South Holland, Netherlands Bernisse Former municipality Church in Oudenhoorn Flag Location in South Holland Coordinates: 51°51′N 4°15′E  /  51.850°N 4.250°E  / 51.850; 4.250 Coordinates: 51°51′N 4°15′E  /  51.850°N 4.250°E  / 51.850; 4.250 Country Netherlands Province South Holland Municipality Nissewaard Area [1]  • Total 68.46 km 2 (26.43 sq mi)  • Land 57.34 km 2 (22.14 sq mi)  • Water 11.12 km 2 (4.29 sq mi) Elevation [2] 0 m (0 ft) Population (August 2017) [3]  • Total data missing Time zone UTC+1 (CET)  • Summer (DST) UTC+2 (CEST) Postcode 3211–3218, 3227 Area code 0181 Website www.gemeentebernisse.nl Bernisse ( pronunciation   ( help · info ) ) is a former municipality in the western Netherlands, in the province of South Holland. Since 2015 it has been a part of the municipality of Nissewaard. The former municipality had a population of data missing in 2017, and c...