glimpse

glimpse(data, max_width=76, engine='pandas')

Takes a pandas DataFrame and prints a summary of its dimensions, column names, data types, and the first few values of each column.

Parameters

Name Type Description Default
data pd.DataFrame The data parameter is a pandas DataFrame that contains the data you want to glimpse at. It is the main input to the glimpse function. required
max_width int The max_width parameter is an optional parameter that specifies the maximum width of each line when printing the glimpse of the DataFrame. If not provided, the default value is set to 76. 76
engine str The engine parameter is used to specify the engine to use for generating a glimpse. It can be either โ€œpandasโ€ or โ€œpolarsโ€. - The default value is โ€œpandasโ€. - When โ€œpolarsโ€, the function will internally use the polars library for generating the glimpse. 'pandas'

Examples

import pytimetk as tk
import pandas as pd

df = tk.load_dataset('walmart_sales_weekly', parse_dates=['Date'])

df.glimpse()
<class 'pandas.core.frame.DataFrame'>: 1001 rows of 17 columns
id:            object            ['1_1', '1_1', '1_1', '1_1', '1_1', '1_ ...
Store:         int64             [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
Dept:          int64             [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
Date:          datetime64[ns]    [Timestamp('2010-02-05 00:00:00'), Time ...
Weekly_Sales:  float64           [24924.5, 46039.49, 41595.55, 19403.54, ...
IsHoliday:     bool              [False, True, False, False, False, Fals ...
Type:          object            ['A', 'A', 'A', 'A', 'A', 'A', 'A', 'A' ...
Size:          int64             [151315, 151315, 151315, 151315, 151315 ...
Temperature:   float64           [42.31, 38.51, 39.93, 46.63, 46.5, 57.7 ...
Fuel_Price:    float64           [2.572, 2.548, 2.514, 2.561, 2.625, 2.6 ...
MarkDown1:     float64           [nan, nan, nan, nan, nan, nan, nan, nan ...
MarkDown2:     float64           [nan, nan, nan, nan, nan, nan, nan, nan ...
MarkDown3:     float64           [nan, nan, nan, nan, nan, nan, nan, nan ...
MarkDown4:     float64           [nan, nan, nan, nan, nan, nan, nan, nan ...
MarkDown5:     float64           [nan, nan, nan, nan, nan, nan, nan, nan ...
CPI:           float64           [211.0963582, 211.2421698, 211.2891429, ...
Unemployment:  float64           [8.106, 8.106, 8.106, 8.106, 8.106, 8.1 ...