framex.load#

load(name: str, *, lazy: bool = False, check_local: bool = True, cache: bool = True) DataFrame | LazyFrame#

Loads dataset by with the given name if available.

Parameters:
  • name (str) – Name of the dataset to load.

  • lazy (bool, optional) – Lazy loading, Default is False

  • check_local (bool, optional) – Whether to check if the dataset is available locally Default is True

  • cache (bool, optional) – Whether to cache the dataset locally. Default is True

Returns:

polars.DataFrame or polars.LazyFrame

Examples

import framex as fx

iris = fx.load('iris')
iris.head()
shape: (5, 5)
sepal_lengthsepal_widthpetal_lengthpetal_widthspecies
f64f64f64f64str
5.13.51.40.2"setosa"
4.93.01.40.2"setosa"
4.73.21.30.2"setosa"
4.63.11.50.2"setosa"
5.03.61.40.2"setosa"

Which is equivalent to direct imports.

from framex import iris

iris.head()
shape: (5, 5)
sepal_lengthsepal_widthpetal_lengthpetal_widthspecies
f64f64f64f64str
5.13.51.40.2"setosa"
4.93.01.40.2"setosa"
4.73.21.30.2"setosa"
4.63.11.50.2"setosa"
5.03.61.40.2"setosa"

Any datasets available can be loaded via direct imports.

import framex as fx

fx.available()
{'remote': ['abortion',
  'absentee',
  'airlines',
  'airports',
  'Alligator',
  'anorexia',
  'Arrests',
  'arthritis',
  'auto',
  'avocado',
  'babies',
  'BeeStings',
  'BirdCalcium',
  'BirdNest',
  'birds',
  'Births',
  'Caterpillars',
  'cherry',
  'Chicago',
  'Chile',
  'Cholera',
  'coffee_price',
  'College',
  'CollegeDistance',
  'comics',
  'commodity_prices',
  'concrete',
  'constants',
  'Contraceptives',
  'country_codes',
  'covid_testing',
  'cpu',
  'crabs',
  'Credit',
  'defects',
  'Diabetes',
  'diamonds',
  'earthquakes',
  'epilepsy',
  'films',
  'fishing',
  'Fitch',
  'flights',
  'Forbes2000',
  'FruitFlies',
  'Gasoline',
  'Gestation',
  'gpa',
  'HealthInsurance',
  'iris',
  'Journals',
  'Ketchup',
  'london_murders',
  'Mortgage',
  'mpg',
  'Municipalities',
  'murders',
  'nba_finals',
  'nba_heights',
  'netflix',
  'oils',
  'olive',
  'oscars',
  'paris2024',
  'penguins',
  'planes',
  'pokemon',
  'population',
  'PorscheJaguar',
  'Pottery',
  'president',
  'Salaries',
  'species',
  'starbucks',
  'stars',
  'storms',
  'titanic',
  'Train',
  'UN',
  'usa_migration',
  'usa_states',
  'Utilities',
  'water',
  'weather',
  'Wells',
  'wine',
  'Yogurt'],
 'local': ['birds', 'diamonds', 'iris', 'mpg', 'penguins', 'titanic']}