File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# jupyterlite). We need the development version of skrub to be able to use the
55# skrub expressions.
66# %%
7+ # %pip install -q https://pypi.anaconda.org/ogrisel/simple/polars/1.24.0/polars-1.24.0-cp39-abi3-emscripten_3_1_58_wasm32.whl
78# %pip install -q holidays https://pypi.anaconda.org/ogrisel/simple/skrub/0.6.dev0/skrub-0.6.dev0-py3-none-any.whl
8-
99# %%
1010import polars as pl
11+ import pandas as pd
12+ from pyarrow .parquet import read_table
1113import skrub
1214from pathlib import Path
1315
3840 "electricity_raw" ,
3941 pl .concat (
4042 [
41- pl .read_csv (data_file , null_values = ["N/A" ])
43+ pl .from_pandas ( pd . read_csv (data_file , na_values = ["N/A" ]) )
4244 for data_file in sorted (data_source_folder .iterdir ())
4345 if data_file .name .startswith ("Total Load - Day Ahead" )
4446 and data_file .name .endswith (".csv" )
9698for city_name in city_names :
9799 all_city_weather_raw [city_name ] = skrub .var (
98100 f"{ city_name } _weather_raw" ,
99- pl .read_parquet ( f"../datasets/weather_{ city_name } .parquet" ),
101+ pl .from_arrow ( read_table ( f"../datasets/weather_{ city_name } .parquet" ) ),
100102 ).with_columns (
101103 [
102104 pl .col ("time" ).dt .cast_time_unit (
116118time .join (all_city_weather_raw ["brest" ], on = "time" , how = "left" )
117119
118120
119-
120121# %%
121122all_city_weather = time
122123for city_name , city_weather_raw in all_city_weather_raw .items ():
You can’t perform that action at this time.
0 commit comments