Need help in python program

Christian Gollwitzer auriocus at gmx.de
Fri Jul 1 15:22:57 EDT 2016


Am 01.07.16 um 12:26 schrieb Archana Sonavane:
> Hello Everyone,
>
> I am doing python code by using API.
>
> My first API giving fields - Itemid, clock and value
> second API giving fields - Itemid, key, units and delay
>
> using for loops for both API.
>
> Could you please tell me how to compare both id by using equal operator.
>
> My output should be :
>
> Itemid, clock, value, key, units and delay
>

I think you want a "join" operation from relational algebra. pandas can 
do that:

http://pandas.pydata.org/pandas-docs/stable/merging.html#database-style-dataframe-joining-merging

or you just store the one table in a dict with Itemd as the key and loop 
over the second, while looking up corresponding values from the dict.

	Christin



More information about the Python-list mailing list