refactoring to monorepo
This commit is contained in:
		
							parent
							
								
									1e0b9f1233
								
							
						
					
					
						commit
						479feba6c2
					
				
							
								
								
									
										0
									
								
								.gitattributes → etl/.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								.gitattributes → etl/.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
								
								
									
										1569
									
								
								pixi.lock → etl/pixi.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1569
									
								
								pixi.lock → etl/pixi.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -25,6 +25,5 @@ pandas = ">=2.2.3,<3"
 | 
			
		||||
plotly = ">=5.24.1,<6"
 | 
			
		||||
duckdb = ">=1.1.2,<2"
 | 
			
		||||
python-dotenv = ">=1.0.1,<2"
 | 
			
		||||
fastapi = ">=0.115.4,<0.116"
 | 
			
		||||
polars = ">=0.20.26,<2"
 | 
			
		||||
pyarrow = ">=18.0.0,<19"
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
	<meta charset="UTF-8">
 | 
			
		||||
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
	<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>
 | 
			
		||||
 | 
			
		||||
    *{
 | 
			
		||||
@ -14,7 +14,11 @@
 | 
			
		||||
      border: 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #dia-capacity{width: 100%; height: 400px;}
 | 
			
		||||
    #dia-capacity{
 | 
			
		||||
      width: 100%; 
 | 
			
		||||
      height: 400px;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    main{
 | 
			
		||||
      display: grid;
 | 
			
		||||
      width: 100%;
 | 
			
		||||
@ -41,6 +45,11 @@
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
  <main>
 | 
			
		||||
 | 
			
		||||
    <article id="timeline">
 | 
			
		||||
    </article>
 | 
			
		||||
      
 | 
			
		||||
    </section>
 | 
			
		||||
    
 | 
			
		||||
    <div>
 | 
			
		||||
    <select>
 | 
			
		||||
@ -143,6 +152,63 @@ const 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>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
							
								
								
									
										22
									
								
								etl/src/gio/test_duckdb.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								etl/src/gio/test_duckdb.py
									
									
									
									
									
										Normal 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
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user