File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1781,7 +1781,7 @@ def head(self, n=5):
1781
1781
Returns first n rows
1782
1782
"""
1783
1783
l = len (self )
1784
- if l == 0 or n == 0 :
1784
+ if l == 0 or n == 0 :
1785
1785
return self
1786
1786
return self .iloc [:n ]
1787
1787
@@ -1794,6 +1794,24 @@ def tail(self, n=5):
1794
1794
return self
1795
1795
return self .iloc [- n :]
1796
1796
1797
+ def left (self , n = 5 ):
1798
+ """
1799
+ Return first n columns
1800
+ """
1801
+ l = self .shape [1 ]
1802
+ if l == 0 or n == 0 :
1803
+ return self
1804
+ return self .iloc [:, :n ]
1805
+
1806
+ def right (self , n = 5 ):
1807
+ """
1808
+ Return last n columns
1809
+ """
1810
+ l = self .shape [1 ]
1811
+ if l == 0 or n == 0 :
1812
+ return self
1813
+ return self .iloc [:, - n :]
1814
+
1797
1815
#----------------------------------------------------------------------
1798
1816
# Attribute access
1799
1817
You can’t perform that action at this time.
0 commit comments