DataFrame.head(0) doesn't return an empty frame · Issue #11930 · pandas-dev/pandas (original) (raw)
pandas.DataFrame({"stuff":[1,2,3,4,5]}).head(0)
returns
stuff 0 1 1 2 2 3 3 4 4 5
I would expect an empty data frame, in the same way that
[1,2,3,4,5][0:0]
returns an empty list.
This is with pandas version 0.15.0.
The documentation (http://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.DataFrame.head.html) says head(n)
returns 'first n rows', so I'd expect 0 rows if n is 0.