DataFrameの先頭または末尾の5行を取得する関数
DataFrameの先頭の5行を取得する方法
headメソッドを使用することで取得できます。
import pandas as pd
df = pd.DataFrame(np.arange(100).reshape(10, 10))
df.head()
OUT

DataFrameの末尾の5行を取得する方法
headメソッドを使用することで取得できます。
import pandas as pd
df = pd.DataFrame(np.arange(100).reshape(10, 10))
df.tail()
OUT
