Pandas like features

mw mingwu at gmail.com
Fri Oct 23 22:47:46 UTC 2020


On Friday, 23 October 2020 at 22:38:39 UTC, mw wrote:
> And from the language perspective, maybe D should adopt 
> Python/Numpy's array indexing syntax, specifically:
>
> 1) use Python's arr[start:end], in addition to D's 
> arr[start..end]
>
> 2) and also allow negative index, instead of [$-1]. (This $ is 
> an improvement of Java/C++'s arr[arr.length -1], but still is 
> less convenient than Python’s negative index syntax).
>
> Python gained such popularity in scientific computing in the 
> past ~10 years is not an accident, actually Guido made that 
> happen by extending Python's syntax:
>
> https://en.wikipedia.org/wiki/NumPy#History
>
> """
> The Python programming language was not originally designed for 
> numerical computing, but attracted the attention of the 
> scientific and engineering community early on. In 1995 the 
> special interest group (SIG) matrix-sig was founded with the 
> aim of defining an array computing package; among its members 
> was Python designer and maintainer Guido van Rossum, who 
> extended Python's syntax (in particular the indexing syntax) to 
> make array computing easier.[6]
> """
>
> Maybe Walter should join one of such SIGs as well :-)

Let me further quote from [6]

"""
During these early years, there was considerable interaction 
between the standard and scientific Python communities. In fact, 
Guido van Rossum, Python's Benevolent Dictator For Life (BDFL), 
was an active member of the matrix-sig. This close interaction 
resulted in Python gaining new features and syntax specifically 
needed by the scientific Python community. While there were 
miscellaneous changes, such as the addition of complex numbers, 
many changes focused on providing a more succinct and easier to 
read syntax for array manipulation. For instance, the parenthesis 
around tuples were made optional so that array elements could be 
accessed through, for example, a[0,1] instead of a[(0,1)]. The 
slice syntax gained a step argument— a[::2] instead of just a[:], 
for example—and an ellipsis operator, which is useful when 
dealing with multidimensional data structures.
"""


[6] 
https://www.computer.org/csdl/magazine/cs/2011/02/mcs2011020009/13rRUx0xPMx




More information about the Digitalmars-d mailing list