La-matrice commited on
Commit
3881c30
1 Parent(s): a8a5f28

Update normalization_parameters

Browse files
Files changed (1) hide show
  1. normalization_parameters +12 -2
normalization_parameters CHANGED
@@ -2,7 +2,7 @@ norm_params = {
2
  'LAT': {'min_val': -66.817333, 'max_val': 51.055833},
3
  'LON': {'min_val': -178.116667, 'max_val': 171.358333},
4
  'ALTI': {'min_val': 0.0, 'max_val': 3845.0},
5
- 'AAAAMMJJHH': {'min_val': 1777010107, 'max_val': 2024030803},
6
  'ANNEE': {'min_val': 1777, 'max_val': 2024},
7
  'MOIS': {'min_val': 1, 'max_val': 12},
8
  'JOUR': {'min_val': 1, 'max_val': 31},
@@ -10,4 +10,14 @@ norm_params = {
10
  }
11
 
12
  def normalize_column(column, min_val, max_val):
13
- return (column.astype('float64') - min_val) / (max_val - min_val)
 
 
 
 
 
 
 
 
 
 
 
2
  'LAT': {'min_val': -66.817333, 'max_val': 51.055833},
3
  'LON': {'min_val': -178.116667, 'max_val': 171.358333},
4
  'ALTI': {'min_val': 0.0, 'max_val': 3845.0},
5
+ 'AAAAMMJJHH': {'min_val': 1777010107, 'max_val': 2024031203},
6
  'ANNEE': {'min_val': 1777, 'max_val': 2024},
7
  'MOIS': {'min_val': 1, 'max_val': 12},
8
  'JOUR': {'min_val': 1, 'max_val': 31},
 
10
  }
11
 
12
  def normalize_column(column, min_val, max_val):
13
+ """Normalize pandas Series from [min_val, max_val] to [0, 1]."""
14
+ return (column.astype('float64') - min_val) / (max_val - min_val)
15
+
16
+ def extract_date_parts(chunk):
17
+ chunk['AAAAMMJJHH'] = chunk['AAAAMMJJHH'].astype(int)
18
+ chunk['ANNEE'] = (chunk['AAAAMMJJHH'] // 1000000).astype(int)
19
+ chunk['MOIS'] = ((chunk['AAAAMMJJHH'] // 10000) % 100).astype(int)
20
+ chunk['JOUR'] = ((chunk['AAAAMMJJHH'] // 100) % 100).astype(int)
21
+ chunk['HEURE'] = (chunk['AAAAMMJJHH'] % 100).astype(int)
22
+ chunk = chunk[(chunk['ANNEE'] <= 2024) & (chunk['MOIS'] <= 12) & (chunk['JOUR'] <= 31)]
23
+ return chunk