@@ -97,26 +97,6 @@ This future dtype inference logic can be enabled with:
97
97
Enhancements
98
98
~~~~~~~~~~~~
99
99
100
- .. _whatsnew_220.enhancements.case_when :
101
-
102
- Create a pandas Series based on one or more conditions
103
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
-
105
- The :func: `case_when ` function has been added to create a Series object based on one or more conditions. (:issue: `39154 `)
106
-
107
- .. ipython :: python
108
-
109
- import pandas as pd
110
-
111
- df = pd.DataFrame(dict (a = [1 , 2 , 3 ], b = [4 , 5 , 6 ]))
112
- default= pd.Series(' default' , index = df.index)
113
- default.case_when(
114
- caselist = [
115
- (df.a == 1 , ' first' ), # condition, replacement
116
- (df.a.gt(1 ) & df.b.eq(5 ), ' second' ), # condition, replacement
117
- ],
118
- )
119
-
120
100
.. _whatsnew_220.enhancements.adbc_support :
121
101
122
102
ADBC Driver support in to_sql and read_sql
@@ -208,6 +188,26 @@ For a full list of ADBC drivers and their development status, see the `ADBC Driv
208
188
Implementation Status <https://arrow.apache.org/adbc/current/driver/status.html> `_
209
189
documentation.
210
190
191
+ .. _whatsnew_220.enhancements.case_when :
192
+
193
+ Create a pandas Series based on one or more conditions
194
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195
+
196
+ The :func: `case_when ` function has been added to create a Series object based on one or more conditions. (:issue: `39154 `)
197
+
198
+ .. ipython :: python
199
+
200
+ import pandas as pd
201
+
202
+ df = pd.DataFrame(dict (a = [1 , 2 , 3 ], b = [4 , 5 , 6 ]))
203
+ default= pd.Series(' default' , index = df.index)
204
+ default.case_when(
205
+ caselist = [
206
+ (df.a == 1 , ' first' ), # condition, replacement
207
+ (df.a.gt(1 ) & df.b.eq(5 ), ' second' ), # condition, replacement
208
+ ],
209
+ )
210
+
211
211
.. _whatsnew_220.enhancements.to_numpy_ea :
212
212
213
213
``to_numpy `` for NumPy nullable and Arrow types converts to suitable NumPy dtype
0 commit comments