{⍵/⍨⍵<50}{2*⍨⍵/⍨1=2|⍵}⍳10
1 9 25 49
About as short as I can make it, and while its longer than the pandas solution, the primitives are significantly more general (sqr, odd - why include these as language primitives?). {} define lambdas
⍺ is the left operand
⍵ is the right operand
⍶/⍹ are the left/right operators (higher-order functions)
← assignment
◊ statement separators
¨/\⌿⍀⍣⍤⍨ builtin higher order functions
After some familiarity it becomes as easy (or easier) to read as any other language. You can encode a remarkable conciseness of expression into each lambda, that you plumb together (similar to unix pipes in a way) in higher order patterns. printf "1,2,3,4\n5,6,7,8" | apl --eval "f←{4⎕CR ⍵}◊s←{⍺~⍨¨⍵⊂⍨1++\⍺⋸⍵}◊f ⊃{⍎⎕UCS ⍵}¨¨44 s¨10 s⊣⎕FIO[41] 0"
┏→━━━━━━┓
↓1 2 3 4┃
┃5 6 7 8┃
┗━━━━━━━┛
DESCRIPTION: --eval ≡ evaluate the text
f ≡ formatting function for printing nested values
s ≡ partition a line of text and remove the partition character
⎕FIO ≡ read stdin as byte stream (see FILE_IO.apl)
⎕UCS ≡ convert bytes to characters
⍎ ≡ execute an expression (convert characters to numbers)
SUMMARY: read stdin as a bytestream
partition at newlines and commas
convert to characters
interpret characters as numbers
disclose into a rank-2 array
format to stdout
one of many possible solutions: