Skip to content

Instantly share code, notes, and snippets.

View levisrum23's full-sized avatar
💭
I may be slow to respond.

Anderson Rumuy levisrum23

💭
I may be slow to respond.
View GitHub Profile
@levisrum23
levisrum23 / Locale_Aware_Type_Conversion.pq
Created January 24, 2026 07:11
Ensuring numerical precision in CSV imports by applying English (United States) locale settings to protect decimal points.
/* Prevents "Data Decay" where decimals are stripped during import.
Critical for pH (7.5 vs 75) and Conductivity readings.
*/
#"Changed Type with Locale" = Table.TransformColumnTypes(
#"Promoted Headers",
{
{"ph", type number},
{"Hardness", type number},
{"Solids", type number},
@levisrum23
levisrum23 / Dynamic_Mean_Imputation_PowerQuery.pq
Created January 24, 2026 07:04
A reusable M-code function to identify and replace null values with column-specific averages across multiple parameters.
/* Author: [Your Name]
Purpose: Industrial Data Cleaning - Handling missing sensor data
Technique: List.Accumulate (Functional Programming in M)
*/
let
// Define columns requiring imputation (e.g., pH, Sulfate, etc.)
ColsToFix = {"ph", "Sulfate", "Trihalomethanes"},
// Recursive loop to replace nulls with calculated mean per column