I have 100 values in a dataframe and I want to print a nice table using tabulate
. This works for me:
print(tabulate(dat], headers='keys', tablefmt='psql'))
Now, this prints out the entire dataframe. I couldn't get the relevant slicing info here: Understanding Python's slice notation
But I want to print out the first 5 values and then a few ...
and then the last 5 values.
Example:
4
2
1
5
1
.
.
4
1
2
4
5
How can I do it?