Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lamda function explanation
#1
Hi All,

Can someone please explain the below code?I am mainly interested in the lambda function lambda x: '{0:0>10}'.format(x). Thanks.
## Add leading zeros to the integer column in Python
 
df['Col1']=df['Col1'].apply(lambda x: '{0:0>10}'.format(x))
print df
TIA
Reply


Messages In This Thread
Lamda function explanation - by mrcool4 - Jul-04-2018, 10:02 AM
RE: Lamda function explanation - by buran - Jul-04-2018, 10:10 AM
RE: Lamda function explanation - by mrcool4 - Jul-04-2018, 10:15 AM
RE: Lamda function explanation - by buran - Jul-04-2018, 10:22 AM
RE: Lamda function explanation - by mrcool4 - Jul-04-2018, 10:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Explanation of code ejKDE 4 436 Feb-26-2024, 02:50 PM
Last Post: ejKDE
  A better explanation of the last post Led_Zeppelin 9 2,447 Sep-20-2022, 05:08 PM
Last Post: deanhystad
  Changing a string value to a numerical value using python code and a lamda function Led_Zeppelin 6 1,654 Jul-05-2022, 11:29 PM
Last Post: deanhystad
  Operator meaning explanation Sherine 3 2,072 Jul-31-2021, 11:05 AM
Last Post: Sherine
  Explanation of except ... as : Fernando_7obink 2 1,968 Feb-13-2021, 04:45 AM
Last Post: deanhystad
  .maketrans() - a piece of code which needs some explanation InputOutput007 5 3,019 Jan-28-2021, 05:05 PM
Last Post: buran
  .remove() from a list - request for explanation InputOutput007 3 2,277 Jan-28-2021, 04:21 PM
Last Post: InputOutput007
  Explanation of the left side of this statement please rascalsailor 3 2,541 Sep-09-2020, 02:02 PM
Last Post: rascalsailor
  Need explanation of one line of code Fliberty 6 3,552 Feb-18-2020, 12:50 AM
Last Post: Fliberty
  explanation of code hikerguy62 2 2,279 Aug-01-2019, 01:37 PM
Last Post: hikerguy62

Forum Jump:

User Panel Messages

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