def preview(df,preview_rows = 20):#,preview_max_cols = 0):
    """ Returns a preview of a dataframe, which contains both header
    rows and tail rows.
    """
    if preview_rows < 4:
        preview_rows = 4
    preview_rows = min(preview_rows,df.shape[0])
    outer = math.floor(preview_rows / 4)
    return pd.concat([df.head(outer),
                      df[outer:-outer].sample(preview_rows-2*outer),
                      df.tail(outer)])
def preview ( df , preview_rows = 20 ) : if preview_rows < 4 : preview_rows = 4 preview_rows = min ( preview_rows , df . shape [ 0 ] ) outer = math . floor ( preview_rows / 4 ) return pd . concat ( [ df . head ( outer ) , df [ outer : - outer ] . sample ( preview_rows - 2 * outer ) , df . tail ( outer ) ] )
Returns a preview of a dataframe, which contains both header
    rows and tail rows.