473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

why not arrays?

Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul

Jul 18 '05 #1
6 1476
Because the "list" object covers all the functionality contained in the
traditional "array" structure. If it pleases you , you can ignore the
additional conveniences the list object offers and just treat it like an
ordinary array.

Unless, of course, what you are seeking are the joys associated with memory
allocation/deallocation :-)
Thomas Bartkus

"Rahul" <co********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul

Jul 18 '05 #2
On Thu, Dec 16, 2004 at 05:51:18AM -0800, Rahul wrote:
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?


Arrays are included in a module in the standard module called 'array'.

-- Gerhard

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBwZjEdIO4ozGCH14RApZ6AKCPVPvwGz0k6pidgRzBUo ayJv4tiwCghuoC
M30JqyqzGgW3BHLr5lVW5c0=
=elGg
-----END PGP SIGNATURE-----

Jul 18 '05 #3
Rahul wrote:
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul

We know of three implementations of arrays now: the "array" module,
the "numpy" implementation, and the "numarray" implementation. Clearly
there are some trade offs here with no clear winner. Until there is a
clear favorite, it would be a bad idea to choose a winner.

--Scott David Daniels
Sc***********@Acm.Org
Jul 18 '05 #4
Rahul wrote:
Hi.
I just wanted to know why arrays have not been included as a builtin
datatype like lists or dictionaries? The numpy extension shows that it
can be implemented. then why not include arrays in core python?
rahul


As Gerhard mentioned, the standard library module 'array' can be used for
data-type specific one-dimensional arrays.

For more complex (i.e. multi-dimensional) arrays - the general answer is "get
numpy". I'm not aware of the actual reasons why numpy is not included in the
standard library, but some possible reasons would be:

- size (increase the base Python download too much)
- portability (less portable than the core interpreter)
- stability (the numpy folks aren't yet prepared to commit to the backwards
compatibility issues associated with being part of the standard library)
- logistics (merging numpy into Python is likely to be a pain)

Cheers,
Nick.

--
Nick Coghlan | nc******@email.com | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.skystorm.net
Jul 18 '05 #5

"Scott David Daniels" <Sc***********@Acm.Org> wrote in message
news:41********@nntp0.pdx.net...
We know of three implementations of arrays now: the "array" module,
This module for mutable linear homogeneous arrays is already included in
Python since long ago. It does not compete with the next two.
the "numpy" implementation, and the "numarray" implementation.


Numpy is the original multidimensional array numerical computation package
from about a decade ago. As far as I know, it is no longer being
supported/upgraded. However, it is still used be other packages that
people use.

Numarray is a newer package that I believe is intended to replace numpy and
which has only recently reached perhaps the same level of stability.

(Updates welcome)

Terry J. Reedy

Jul 18 '05 #6

"Nick Coghlan" <nc******@iinet.net.au> wrote in message
news:41**************@iinet.net.au...
For more complex (i.e. multi-dimensional) arrays - the general answer is
"get numpy". I'm not aware of the actual reasons why numpy is not
included in the standard library, but some possible reasons would be:

- size (increase the base Python download too much)
- portability (less portable than the core interpreter)
- stability (the numpy folks aren't yet prepared to commit to the
backwards compatibility issues associated with being part of the standard
library)
- logistics (merging numpy into Python is likely to be a pain)


The base issue for all third-party package is *ownership* and attendent
issues of who controls style, contents, and timing of changes.
Transferring code or a version thereof from original authors to the PSF has
pluses and minuses for both parties.

Terry J. Reedy

Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Canonical Latin | last post by:
"Leor Zolman" <leor@bdsoft.com> wrote > "Canonical Latin" <javaplus@hotmail.com> wrote: > > > ... > >But I'm still curious as to the rational of having type >...
21
by: Matteo Settenvini | last post by:
Ok, I'm quite a newbie, so this question may appear silly. I'm using g++ 3.3.x. I had been taught that an array isn't a lot different from a pointer (in fact you can use the pointer arithmetics to...
5
by: JezB | last post by:
What's the easiest way to concatenate arrays ? For example, I want a list of files that match one of 3 search patterns, so I need something like DirectoryInfo ld = new DirectoryInfo(searchDir);...
3
by: Michel Rouzic | last post by:
It's the first time I try using structs, and I'm getting confused with it and can't make it work properly I firstly define the structure by this : typedef struct { char *l1; int *l2; int Nval; }...
1
by: Rob Griffiths | last post by:
Can anyone explain to me the difference between an element type and a component type? In the java literature, arrays are said to have component types, whereas collections from the Collections...
41
by: Rene Nyffenegger | last post by:
Hello everyone. I am not fluent in JavaScript, so I might overlook the obvious. But in all other programming languages that I know and that have associative arrays, or hashes, the elements in...
6
by: Robert Bravery | last post by:
Hi all, Can some one show me how to achieve a cross product of arrays. So that if I had two arrays (could be any number) with three elements in each (once again could be any number) I would get:...
1
by: Doug_J_W | last post by:
I have a Visual Basic (2005) project that contains around twenty embedded text files as resources. The text files contain two columns of real numbers that are separated by tab deliminator, and are...
16
by: mike3 | last post by:
(I'm xposting this to both comp.lang.c++ and comp.os.ms- windows.programmer.win32 since there's Windows material in here as well as questions related to standard C++. Not sure how that'd go over...
29
weaknessforcats
by: weaknessforcats | last post by:
Arrays Revealed Introduction Arrays are the built-in containers of C and C++. This article assumes the reader has some experiece with arrays and array syntax but is not clear on a )exactly how...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.