File tree 1 file changed +69
-0
lines changed
1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -3563,6 +3563,40 @@ def head(self, n=5):
3563
3563
-------
3564
3564
obj_head : type of caller
3565
3565
The first n rows of the caller object.
3566
+
3567
+ See Also
3568
+ --------
3569
+ pandas.DataFrame.tail
3570
+
3571
+ Examples
3572
+ --------
3573
+ >>> df = pd.DataFrame({'animal':['bear', 'bee', 'falcon',
3574
+ ... 'lion', 'monkey', 'parrot', 'shark']})
3575
+ >>> df
3576
+ animal
3577
+ 0 bear
3578
+ 1 bee
3579
+ 2 falcon
3580
+ 3 lion
3581
+ 4 monkey
3582
+ 5 parrot
3583
+ 6 shark
3584
+
3585
+ Viewing the first 5 lines
3586
+ >>> df.head()
3587
+ animal
3588
+ 0 bear
3589
+ 1 bee
3590
+ 2 falcon
3591
+ 3 lion
3592
+ 4 monkey
3593
+
3594
+ Viewing the first n lines (three in this case)
3595
+ >>> df.head(3)
3596
+ animal
3597
+ 0 bear
3598
+ 1 bee
3599
+ 2 falcon
3566
3600
"""
3567
3601
3568
3602
return self .iloc [:n ]
@@ -3580,6 +3614,41 @@ def tail(self, n=5):
3580
3614
-------
3581
3615
obj_tail : type of caller
3582
3616
The last n rows of the caller object.
3617
+
3618
+ See Also
3619
+ --------
3620
+ pandas.DataFrame.head
3621
+
3622
+ Examples
3623
+ --------
3624
+ >>> df = pd.DataFrame({'animal':['falcon', 'parrot', 'lion',
3625
+ ... 'monkey', 'shark', 'bee', 'bear']})
3626
+ >>> df
3627
+ animal
3628
+ 0 bear
3629
+ 1 bee
3630
+ 2 falcon
3631
+ 3 lion
3632
+ 4 monkey
3633
+ 5 parrot
3634
+ 6 shark
3635
+
3636
+ Viewing the last 5 lines
3637
+ >>> df.tail()
3638
+ animal
3639
+ 2 falcon
3640
+ 3 lion
3641
+ 4 monkey
3642
+ 5 parrot
3643
+ 6 shark
3644
+
3645
+ Viewing the last n lines (three in this case)
3646
+ >>> df.tail(3)
3647
+ animal
3648
+ 4 monkey
3649
+ 5 parrot
3650
+ 6 shark
3651
+
3583
3652
"""
3584
3653
3585
3654
if n == 0 :
You can’t perform that action at this time.
0 commit comments