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 Falsecheck_local (
bool, optional) – Whether to check if the dataset is available locally Default is Truecache (
bool, optional) – Whether to cache the dataset locally. Default is True
- Returns:
polars.DataFrameorpolars.LazyFrame
Examples
import framex as fx iris = fx.load('iris') iris.head()
shape: (5, 5)sepal_length sepal_width petal_length petal_width species f64 f64 f64 f64 str 5.1 3.5 1.4 0.2 "setosa" 4.9 3.0 1.4 0.2 "setosa" 4.7 3.2 1.3 0.2 "setosa" 4.6 3.1 1.5 0.2 "setosa" 5.0 3.6 1.4 0.2 "setosa" Which is equivalent to direct imports.
from framex import iris iris.head()
shape: (5, 5)sepal_length sepal_width petal_length petal_width species f64 f64 f64 f64 str 5.1 3.5 1.4 0.2 "setosa" 4.9 3.0 1.4 0.2 "setosa" 4.7 3.2 1.3 0.2 "setosa" 4.6 3.1 1.5 0.2 "setosa" 5.0 3.6 1.4 0.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']}