File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1574,8 +1574,8 @@ dtypes:
1574
1574
' float64' : np.arange(4.0 , 7.0 ),
1575
1575
' bool1' : [True , False , True ],
1576
1576
' bool2' : [False , True , False ],
1577
- ' dates' : pd.date_range(' now' , periods = 3 ).values}) ,
1578
- ' category' : pd.Categorical(list (" ABC) )
1577
+ ' dates' : pd.date_range(' now' , periods = 3 ).values,
1578
+ ' category' : pd.Categorical(list (" ABC" ))} )
1579
1579
df[' tdeltas' ] = df.dates.diff()
1580
1580
df[' uint64' ] = np.arange(3 , 6 ).astype(' u8' )
1581
1581
df[' other_dates' ] = pd.date_range(' 20130101' , periods = 3 ).values
Original file line number Diff line number Diff line change @@ -228,11 +228,11 @@ Appending levels can be done by assigning a levels list longer than the current
228
228
Adding levels in other positions can be done with ``.reorder_levels(<levels_including_new>) ``.
229
229
230
230
Removing a level is also possible, but only the last level(s) can be removed by assigning a
231
- shorter list than current levels. Values which are omitted are replaced by `np.nan `.
231
+ shorter list than current levels. Values which are omitted are replaced by `` np.nan ` `.
232
232
233
233
.. ipython :: python
234
234
235
- s.levels = [1 ,2 ]
235
+ s.cat. levels = [1 ,2 ]
236
236
s
237
237
238
238
.. note ::
@@ -322,7 +322,7 @@ old levels:
322
322
.. ipython :: python
323
323
324
324
s3 = pd.Series(pd.Categorical([" a" ," b" ," d" ]))
325
- s3.cat.reorder_levels([" a" ," b" ," c" ,d" ])
325
+ s3.cat.reorder_levels([" a" ," b" ," c" ," d" ])
326
326
s3
327
327
328
328
You can’t perform that action at this time.
0 commit comments