load_dataset

load_dataset(dataset='small_table', tbl_type='polars')

Load a dataset hosted in the library as specified DataFrame type.

Parameters

dataset : Literal['small_table', 'game_revenue'] = 'small_table'

The name of the dataset to load. Current options are "small_table" and "game_revenue".

tbl_type : Literal['polars', 'pandas', 'duckdb'] = 'polars'

The type of DataFrame to generate from the dataset. The named options are "polars", "pandas", and "duckdb".

Returns

: FrameT | Any

The dataset for the Validate object. This could be a Polars DataFrame, a Pandas DataFrame, or a DuckDB table as an Ibis table.

Examples

Load the small_table dataset as a Polars DataFrame by calling load_dataset() with its defaults:

import pointblank as pb

small_table = pb.load_dataset()

small_table
shape: (13, 8)
date_timedateabcdef
datetime[μs]datei64stri64f64boolstr
2016-01-04 11:00:002016-01-042"1-bcd-345"33423.29true"high"
2016-01-04 00:32:002016-01-043"5-egh-163"89999.99true"low"
2016-01-05 13:32:002016-01-056"8-kdg-938"32343.23true"high"
2016-01-06 17:23:002016-01-062"5-jdo-903"null3892.4false"mid"
2016-01-09 12:36:002016-01-098"3-ldm-038"7283.94true"low"
2016-01-20 04:30:002016-01-203"5-bce-642"9837.93false"high"
2016-01-20 04:30:002016-01-203"5-bce-642"9837.93false"high"
2016-01-26 20:07:002016-01-264"2-dmx-010"7833.98true"low"
2016-01-28 02:51:002016-01-282"7-dmx-010"8108.34false"low"
2016-01-30 11:23:002016-01-301"3-dka-303"null2230.09true"high"

The game_revenue dataset can be loaded as a Pandas DataFrame by specifying the dataset name and setting tbl_type="pandas":

import pointblank as pb

game_revenue = pb.load_dataset(dataset="game_revenue", tbl_type="pandas")

game_revenue
player_id session_id session_start time item_type item_name item_revenue session_duration start_day acquisition country
0 ECPANOIXLZHF896 ECPANOIXLZHF896-eol2j8bs 2015-01-01 01:31:03+00:00 2015-01-01 01:31:27+00:00 iap offer2 8.991 16.3 2015-01-01 google Germany
1 ECPANOIXLZHF896 ECPANOIXLZHF896-eol2j8bs 2015-01-01 01:31:03+00:00 2015-01-01 01:36:57+00:00 iap gems3 22.491 16.3 2015-01-01 google Germany
2 ECPANOIXLZHF896 ECPANOIXLZHF896-eol2j8bs 2015-01-01 01:31:03+00:00 2015-01-01 01:37:45+00:00 iap gold7 107.991 16.3 2015-01-01 google Germany
3 ECPANOIXLZHF896 ECPANOIXLZHF896-eol2j8bs 2015-01-01 01:31:03+00:00 2015-01-01 01:42:33+00:00 ad ad_20sec 0.760 16.3 2015-01-01 google Germany
4 ECPANOIXLZHF896 ECPANOIXLZHF896-hdu9jkls 2015-01-01 11:50:02+00:00 2015-01-01 11:55:20+00:00 ad ad_5sec 0.030 35.2 2015-01-01 google Germany
... ... ... ... ... ... ... ... ... ... ... ...
1995 NAOJRDMCSEBI281 NAOJRDMCSEBI281-j2vs9ilp 2015-01-21 01:57:50+00:00 2015-01-21 02:02:50+00:00 ad ad_survey 1.332 25.8 2015-01-11 organic Norway
1996 NAOJRDMCSEBI281 NAOJRDMCSEBI281-j2vs9ilp 2015-01-21 01:57:50+00:00 2015-01-21 02:22:14+00:00 ad ad_survey 1.350 25.8 2015-01-11 organic Norway
1997 RMOSWHJGELCI675 RMOSWHJGELCI675-vbhcsmtr 2015-01-21 02:39:48+00:00 2015-01-21 02:40:00+00:00 ad ad_5sec 0.030 8.4 2015-01-10 other_campaign France
1998 RMOSWHJGELCI675 RMOSWHJGELCI675-vbhcsmtr 2015-01-21 02:39:48+00:00 2015-01-21 02:47:12+00:00 iap offer5 26.091 8.4 2015-01-10 other_campaign France
1999 GJCXNTWEBIPQ369 GJCXNTWEBIPQ369-9elq67md 2015-01-21 03:59:23+00:00 2015-01-21 04:06:29+00:00 ad ad_5sec 0.120 18.5 2015-01-14 organic United States

2000 rows × 11 columns