From 3ad3653b8b5e0ab8c8ea9e6393efa5b847817754 Mon Sep 17 00:00:00 2001 From: Sathvik Mulukutla Date: Thu, 14 Dec 2023 17:00:05 +0530 Subject: [PATCH] bruh --- pandas/core/frame.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index c15ff444a10bc..4e61e9b24e720 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -10365,11 +10365,28 @@ def map( 0 1 0 3 4 1 5 5 +<<<<<<< HEAD >>> df.map(round, digits=2) 0 1 0 1.00 2.12 1 3.36 4.57 +======= + + >>> def foo(x): + if x > 2.5: + x = 2 + + elif x <= 2.5: + x = 1 + + return x + + >>> df.map(foo) + 0 1 + 0 1 1 + 1 2 2 +>>>>>>> parent of 6f40da17ba (Updated Documentation for the map method) Like Series.map, NA values can be ignored: