Compare commits

...

1 Commits

Author SHA1 Message Date
Giò Diani 479feba6c2 refactoring to monorepo 2024-11-28 16:38:18 +01:00
1425 changed files with 13769 additions and 1587 deletions

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,5 @@ pandas = ">=2.2.3,<3"
plotly = ">=5.24.1,<6" plotly = ">=5.24.1,<6"
duckdb = ">=1.1.2,<2" duckdb = ">=1.1.2,<2"
python-dotenv = ">=1.0.1,<2" python-dotenv = ">=1.0.1,<2"
fastapi = ">=0.115.4,<0.116"
polars = ">=0.20.26,<2" polars = ">=0.20.26,<2"
pyarrow = ">=18.0.0,<19" pyarrow = ">=18.0.0,<19"

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
<script src=" https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js "></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js"></script>
<style> <style>
*{ *{
@ -14,7 +14,11 @@
border: 0; border: 0;
} }
#dia-capacity{width: 100%; height: 400px;} #dia-capacity{
width: 100%;
height: 400px;
}
main{ main{
display: grid; display: grid;
width: 100%; width: 100%;
@ -41,6 +45,11 @@
</head> </head>
<body> <body>
<main> <main>
<article id="timeline">
</article>
</section>
<div> <div>
<select> <select>
@ -143,6 +152,63 @@ const option = {
}; };
option && myChart.setOption(option); option && myChart.setOption(option);
const timelineChart = document.getElementById('timeline');
timelineChart.setOption({
// This is the properties of `baseOption`.
timeline: {
// each item in `timeline.data` corresponds to each
// `option` in `options` array.
data: ['2002-01-01', '2003-01-01', '2004-01-01']
},
title: {
subtext: ' Data is from National Bureau of Statistics '
},
series: [{
// other configurations of series 1
type: 'bar',
}, {
// other configurations of series 2
type: 'line',
}, {
// other configurations of series 3
type: 'pie',
}],
// `switchableOption`s:
options: [{
// it is an option corresponding to '2002-01-01'
title: {
text: 'the statistics of the year 2002'
},
series: [
{ data: [] }, // the data of series 1
{ data: [] }, // the data of series 2
{ data: [] } // the data of series 3
]
}, {
// it is an option corresponding to '2003-01-01'
title: {
text: 'the statistics of the year 2003'
},
series: [
{ data: [] },
{ data: [] },
{ data: [] }
]
}, {
// it is an option corresponding to '2004-01-01'
title: {
text: 'the statistics of the year 2004'
},
series: [
{ data: [] },
{ data: [] },
{ data: [] }
]
}]
});
</script> </script>
</body> </body>

View File

@ -0,0 +1,22 @@
import polars as pl
import data
inst = data.load()
test = inst.extractions_for(1).pl()
out = test.with_columns(
pl.col("calendar").str.extract_all(r"([0-9]{4}-[0-9]{2}-[0-9]{2})|[0-2]").alias("extracted_nrs"),
)
out.drop(['calendar', 'property_id'])
ll = out.get_column("extracted_nrs").explode().gather_every(2)
llo = out.get_column("extracted_nrs").explode().gather_every(2, offset=1)
lli = ll.list.concat(llo)
print(ll)
print(lli)

Some files were not shown because too many files have changed in this diff Show More