Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python code snippet
#3
Thanks Shay for your quick help.
Im able to understand now about this part of code.
But if the "if" condition is modified and it also depends on 'i'
as shown below,
 
f = lambda x : (
            [L[i] 
            for i in range(2) 
            if x >= M[i] and x < M[i+1]]
            [0])
        
        return np.vectorize(f, otypes=[np.uint32])(Array)
Will it behave the same.
Reply


Messages In This Thread
python code snippet - by chinna - Mar-13-2019, 04:40 PM
RE: python code snippet - by Shay - Mar-13-2019, 05:11 PM
RE: python code snippet - by chinna - Mar-13-2019, 05:58 PM
RE: python code snippet - by Shay - Mar-13-2019, 07:46 PM
RE: python code snippet - by chinna - Mar-15-2019, 06:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in output of a snippet code akbarza 2 440 Feb-28-2024, 07:15 PM
Last Post: deanhystad
  [Solved] Trying to rerun a snippet of code paracel 3 1,222 Jul-17-2022, 01:49 PM
Last Post: paracel
  Can someone explain this small snippet of code like I am a 5 year old? PythonNPC 3 1,307 Apr-08-2022, 05:54 PM
Last Post: deanhystad
  English interpretation of the following file handing snippet mortch 5 3,295 May-30-2019, 08:10 AM
Last Post: mortch
  Unable to read csv file inside full code snippet, at the same time its working seprat sreeraj 2 3,077 Jan-28-2018, 07:25 PM
Last Post: sreeraj

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020