FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
c# linq Linq to Python (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: c# linq Linq to Python
#25188
hrishy (Visitor)
Click here to see the profile of this user
Birthdate:
c# linq Linq to Python  
Code: :
     var stoogeGuys =          Beginning with the _xml_ source          from _xml_Guys in    _xml_Source.Descendants( Stooge )          Join to the array on the common element     stoogeName           join arrayGuys in familyFacts                on    _xml_Guys.Element( stoogeName ).Value equals    arrayGuys.stoogeName          Join to the data_base_ on the common element     stoogeName           join dbGuys in stoogeContext.stoogeTables                on    _xml_Guys.Element( stoogeName ).Value equals    dbGuys.stoogeName          select new          {             firstName    = dbGuys.stoogeName,             familyName   = arrayGuys.familyName,             birthDate    =    _xml_Guys.Element( birthDate ).Value,             deathDate    =    _xml_Guys.Element( deathDate ).Value,             hairCut_style_ = dbGuys.stoogeHaircut,          };     
It could e.g. look like this in Python: stoogeGuys = [] for _xml_Guys in _xml_Source.Descendants[ Stooge ]:     arrayGuys = familyFacts[_xml_Guys.stoogeName]     dbGuys = stoogeContext.stoogeTables[_xml_Guys.stoogeName]     stoogeGuys +=        [{'firstName':    dbGuys.stoogeName,          'familyName':   arrayGuys.familyName,          'birthDate':    _xml_Guys.birthDate,          'deathDate':    dbGuys.deathDate,          'hairCut_style_': dbGuys.stoogeHaircut}]
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#25189
sturlamolden (Visitor)
Click here to see the profile of this user
Birthdate:
c# linq Linq to Python  
Pardon my ignorance again but id ont see any join in python or did i miss something ? It's more Pythonic to use the syntax of dictionary lookups.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#25190
hrishy (Visitor)
Click here to see the profile of this user
Birthdate:
c# linq Linq to Python  
Pardon my ignorance again but id ont see any join in python or did i miss something ? It's more Pythonic to use the syntax of dictionary lookups.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#25191
Duncan Booth (Visitor)
Click here to see the profile of this user
Birthdate:
c# linq Linq to Python  
BTW, a minor correction: LINQ statements are closer to generators, not list comprehensions. They don't actually evaluate their results until you iterate over them and you can re-used the same LINQ statement multiple times getting different results if the data has changed. Python has generator _expression_s with the same syntax as list comprehensions, except you use () instead of []. It might surprise you to know that I have actually come across generator _expression_s. :^) My wording was deliberate: LINQ queries are re-usable, so are Python's generators, but generator _expression_s are not. The comparison isn't exact, you have to call the generator to get an iterator whereas a LINQ _expression_ gives you something which is directly iterable.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#25192
sturlamolden (Visitor)
Click here to see the profile of this user
Birthdate:
c# linq Linq to Python  
No Python's syntax is fine. The api's aren't as consistent though: Microsoft added a common set of extension methods which work on data_base_s, _xml_, builtin sequences and can be easily extended to include other custom sequences. That is correct, but it is a library issue and cannot be solved by adding new syntax.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#25193
c# linq Linq to Python  
Microsoft added a common set of extension methods which work on data_base_s, _xml_, builtin sequences and can be easily extended to include other custom sequences. When the processing is done in memory, LINQ may also work well with multi-core CPUs, see PLINQ. Bye, bearophile
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


-----------------------------------------------------------------------------------------------------------------------------------
To open and print manuals use Adobe Reader. You can download it from Adobe's site. Click here to dlownload Adobe Reader.


COPYRIGHT 2007 MANUALS-LIBRARY - THE LARGEST ONLINE MANUSALS DOWNLOAD SOURCE
apartments in sopot - Blog.de und Datenschutz? - Free sms gateway - Rechnung - Blond - Detox - prepaid phone card - Art Gallery - Kahrs - jobs new york - Jokes - Myspace proxy - mp3 download websites - Firmenadressen - stumer schreis
Get Free Stuff
Search Exchange Web Portal SpyderMap
projektowanie wnętrz | BitThe Informacje Komputerowe | motoryzacja Motoryzacja motoryzacja | Sklep, torebki damskie | najlepsze inwestycje w kraju | Kabaret Made In China | Lokaty bankowe | biznes | Pożyczki gotówkowe Pożyczki Pożyczki gotówkowe | Biznes informacje | Tania Wypożyczalnia samochodów Warszawa Lotnisko | Tanie perfumy dolce gabana - gwarancja jakości. | Nowoczesny ekspres ciśnieniowy do kawy | pluginy do photoshopa pluginy onone onone software | Adder Gry dla Dzieci parkiet strona ciekawostki alarmy alarm satel Moda Modny portal Fotografowanie Pozycjonowanie