Lookup values from one table to another based on a value

  • Thread starter Bruno Desthuilliers
  • Start date
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
(snip)
If I flipped the Table being looked up not to repeat, would that make
things easier to look up a value in?

Don't repeat informations.
 
K

koutoo

If I wanted to accomplish looking up values from one table based on a
value from another table or file, how would I go about doing this in
Python? Would I build a dictionary or an array?

exp:

Table1:

Site = 103
Lane = 2
Dir = ? # Get this from Table2

Table2:

Site, Lane, Direction,
103, 1, 1
103, 2, 1
103, 3, 5
103, 4, 5

Normally in Access I would just use a Dlookup and be done with it, or
use a Recordset in VB. Thanks guys.

Kou
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
If I wanted to accomplish looking up values from one table based on a
value from another table or file, how would I go about doing this in
Python? Would I build a dictionary or an array?

exp:

Table1:

Site = 103
Lane = 2
Dir = ? # Get this from Table2

Table2:

Site, Lane, Direction,
103, 1, 1
103, 2, 1
103, 3, 5
103, 4, 5

Normally in Access I would just use a Dlookup and be done with it, or
use a Recordset in VB. Thanks guys.

What about using a database ? Like SQLite ?

Else, the canonical data structure for quick lookups is of course the dict.
 
K

koutoo

(e-mail address removed) a écrit :







What about using a database ? Like SQLite ?

Else, the canonical data structure for quick lookups is of course the dict.- Hide quoted text -

- Show quoted text -


Ah, yes, that would appear to be a better means to retrieve data. I
visited the site, which version should I download? Thanks.

Kou
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
Ah, yes, that would appear to be a better means to retrieve data. I
visited the site, which version should I download? Thanks.

The latest, unless you have reasons to choose an old one !-)
 
K

koutoo

(e-mail address removed) a écrit :



The latest, unless you have reasons to choose an old one !-)


If I flipped the Table being looked up not to repeat, would that make
things easier to look up a value in?

Exp:

Table1

Site = 103
Lane = 1
Direction = ?
FHWA Lane = ?

Table2

Site, Lane 1, Direction 1, FHWA Lane 1,
103, 1, 1, 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top