473,756 Members | 6,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2489
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
2341
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 a list of 200 items?
6
2048
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
2286
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 amounts of text in a field? Dave
0
1069
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 project involves automation of Word, Excel etc on the CLIENT side. I have binary data which is an EXE file stored inside an SQL Server Image table which I need to pass to the clients browser and create the original EXE file on their hard disk....
6
2502
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 stocks on the two major markets plus some extras, 255 tradying days a year for 20 years, that is about 36 million entries. Obviously a database is a logical choice for that. However I've never used one, nor do I know what benefits I would get...
57
10842
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, but starts to perform badly for me inserting roughly 5M keys: # keys dictionary metakit (both using psyco) ------ ---------- ------- 1M 8.8s 22.2s
9
2288
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 of view, ini-files are more comfortable to read and edit) Where should I store user specific config data? Where should I store machine specific config data?
7
10827
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 doing a proof-of-concept on WCF whereby we have a Windows form client and a Server. Our server is a middle-tier that interfaces with our SQL 05 database server.
17
3577
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 based on a job title. So if a cleaner joins the company we know that they need the sweeping up training and the mopping up training. I wasn't sure how to store this information but this is what i came up with and as you will see i have hit a...
0
9487
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10069
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.