I want to print my dataframe. Unfortunately the picture shows only 2 lines of the dataframe instead of the 20 lines and the table is below and there is a huge empty area as well.. Could someone help me to get all the 20 lines of the dataframe?
This is the source How to save a pandas DataFrame table as a png
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import table # EDIT: see deprecation warnings below
from pathlib import Path
PATH_DATA = "../data"
PATH_RETAILROCKET = Path(PATH_DATA,"retailrocket/retailrocket/events.csv")
# RetailRocket
print(PATH_RETAILROCKET)
df = pd.read_csv(Path(PATH_RETAILROCKET))
df = df.head(20)
ax = plt.subplot(111, frame_on=False) # no visible frame
ax.xaxis.set_visible(False) # hide the x axis
ax.yaxis.set_visible(False) # hide the y axis
table(ax, df) # where df is your data frame
plt.savefig('mytable.png')