File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -1225,7 +1225,7 @@ The dimension of the returned result can also change:
12251225that is itself a series, and possibly upcast the result to a DataFrame:
12261226
12271227.. ipython :: python
1228- :okwarning:
1228+ :okwarning:
12291229
12301230 def f (x ):
12311231 return pd.Series([x, x ** 2 ], index = [" x" , " x^2" ])
Original file line number Diff line number Diff line change @@ -243,16 +243,26 @@ Convenience methods ``ffill`` and ``bfill`` have been added:
243243 function, that is itself a series, and possibly upcast the result to a
244244 DataFrame
245245
246- .. ipython :: python
247- :okwarning:
248-
249- def f (x ):
250- return pd.Series([x, x ** 2 ], index = [" x" , " x^2" ])
251-
252-
253- s = pd.Series(np.random.rand(5 ))
254- s
255- s.apply(f)
246+ .. code-block :: python
247+
248+ >> > def f (x ):
249+ ... return pd.Series([x, x ** 2 ], index = [" x" , " x^2" ])
250+ >> >
251+ >> > s = pd.Series(np.random.rand(5 ))
252+ >> > s
253+ 0 0.340445
254+ 1 0.984729
255+ 2 0.919540
256+ 3 0.037772
257+ 4 0.861549
258+ dtype: float64
259+ >> > s.apply(f)
260+ x x^ 2
261+ 0 0.340445 0.115903
262+ 1 0.984729 0.969691
263+ 2 0.919540 0.845555
264+ 3 0.037772 0.001427
265+ 4 0.861549 0.742267
256266
257267 - New API functions for working with pandas options (:issue: `2097 `):
258268
You can’t perform that action at this time.
0 commit comments