473,387 Members | 1,495 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,387 software developers and data experts.

storing large amounts of data in a list/dictionary

Hi,

Basically, what I'm trying to do is store large amounts of data in a
list or dictionary and then convert that to a custom formatted xml
file.

My list looks roughly like this:
(d[],r[c[d[p[],p[R,C,I]]]])

My question is, would it be faster to use a dictionary if the elements
of the lists have to be put in alphebetical order, or just use lists as
above(since hashes are faster supposedly)?

{d;d[],r;name[{d;d[{p;p[]}],c;name[{d;d[{p;p[]}]}]}]}

Please consider the amount of code necessary to create/decode this

(and sorry if this doesn't make any sense..)

-thanks

Jul 18 '05 #1
2 2468
flamesrock a écrit :
Hi,

Basically, what I'm trying to do is store large amounts of data in a
list or dictionary and then convert that to a custom formatted xml
file.

My list looks roughly like this:
(d[],r[c[d[p[],p[R,C,I]]]])

My question is, would it be faster to use a dictionary if the elements
of the lists have to be put in alphebetical order,

d = {"e" : 32, "f": 44, "a" : 1, "z" : 99}
for k in d: print k

....
a
z
e
f

Well... Just *don't* rely on *any* order with dicts.

If you need fast keyed access to a very large dataset, you may want to
have a look at btrees (one possible implementation here :
http://zopewiki.org/BTree).

Now since it's XML related, this may also (or not) be useful:
http://effbot.org/zone/celementtree.htm
http://effbot.org/zone/element-index.htm

HTH
Bruno
Jul 18 '05 #2
Thanks for the reply ;)

I was hoping not to complicate things with zope, tho Btrees look
interesting.

Oh - and about the xml, I'm using something very similar to elementree
which I found in the python cookbook:
http://aspn.activestate.com/ASPN/Coo.../Recipe/157358

Bruno Desthuilliers wrote:
flamesrock a écrit :
Hi,

Basically, what I'm trying to do is store large amounts of data in a
list or dictionary and then convert that to a custom formatted xml
file.

My list looks roughly like this:
(d[],r[c[d[p[],p[R,C,I]]]])

My question is, would it be faster to use a dictionary if the elements of the lists have to be put in alphebetical order, >>> d = {"e" : 32, "f": 44, "a" : 1, "z" : 99}
>>> for k in d: print k

...
a
z
e
f

Well... Just *don't* rely on *any* order with dicts.

If you need fast keyed access to a very large dataset, you may want

to have a look at btrees (one possible implementation here :
http://zopewiki.org/BTree).

Now since it's XML related, this may also (or not) be useful:
http://effbot.org/zone/celementtree.htm
http://effbot.org/zone/element-index.htm

HTH
Bruno


Jul 18 '05 #3

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

Similar topics

1
by: michaaal | last post by:
If I use a form to pass data (say, for example, through a textbox) the data seems to be limited to somewhat smaller amounts. What should I do if I want to pass a large amount of data? For example...
6
by: supercomputer | last post by:
I am using this function to parse data I have stored in an array. This is what the array looks like: , , , , , , , , , , , , , , , , , , , , , , , ] This is the code to parse the array:
1
by: dave123 | last post by:
I am using a access database to store data that is accesses by an asp web page. When I format a field as text the most that I can store in it is 255 characters. Is there a way of storing larger...
0
by: Michael Bredbury | last post by:
I am developing using Visual Studio .NET 2002 using ASP.NET and VB.NET. This is a web-based project which needs to install various ActiveX components on the users PC. ActiveX is needed because the...
6
by: Mudcat | last post by:
Hi, I am trying to build a tool that analyzes stock data. Therefore I am going to download and store quite a vast amount of it. Just for a general number - assuming there are about 7000 listed...
57
by: Chris Foote | last post by:
Hi all. I have the need to store a large (10M) number of keys in a hash table, based on a tuple of (long_integer, integer). The standard python dictionary works well for small numbers of keys,...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
7
by: =?Utf-8?B?TW9iaWxlTWFu?= | last post by:
Hello everyone: I am looking for everyone's thoughts on moving large amounts (actually, not very large, but large enough that I'm throwing exceptions using the default configurations). We're...
17
by: Stubert | last post by:
I have a training module db that stores information about employees and what training they have carried our or need to carry out. One table in this database stores what training needs to be carried...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.