| I use a similar function when I want to see everything: ``` def showAllRows(dataframeToShow): with pd.option_context('display.max_rows', None, 'display.max_columns', None):
display(dataframeToShow)
# calling it while limiting the number of returned rows.showAllRows(df.head(1000)) ``` Be warned though! if you call this function without limiting the number of rows to be fetched, it is guaranteed you will crash your machine. Always use head, sample or slices. If do get a crush, then your only option is to open the ipynb file with vi and manually delete the millions of lines this function created. Another function that I like is: ``` def showColumns(df, substring): print([x for x in df.columns if substring in x])
return
# calling itshowColumns(df, "year") ``` This is useful in data frames with many columns, when you want to find all the columns that have a specific string in their name. It returns a string, which then you can pass it in the dataframe to print only these columns. |