Using Python3
sudo apt install python3.8-venv
python3 -m venv env_name
source env_name/bin/activate
| """ | |
| csv_chunk_processor.py | |
| ====================== | |
| Production-ready, memory-efficient CSV processor with UUID-aware chunking. | |
| Core guarantee | |
| -------------- | |
| ALL rows belonging to a single UUID are ALWAYS written to the same chunk file. | |
| A UUID's rows are NEVER split across two chunks. |
| from pyspark.sql import SparkSession | |
| from pyspark.sql.functions import col, mean | |
| from pyspark.sql.types import DoubleType | |
| from pyspark.ml import Pipeline | |
| from pyspark.ml.feature import VectorAssembler, StringIndexer | |
| from pyspark.ml.classification import LogisticRegression | |
| from pyspark.ml.evaluation import BinaryClassificationEvaluator, MulticlassClassificationEvaluator | |
| spark = SparkSession.builder.getOrCreate() | |
| print(f" spark version {spark.version}") |
Using Python3
sudo apt install python3.8-venv
python3 -m venv env_name
source env_name/bin/activate
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>C02</title> | |
| </head> |
| import pickle | |
| import jsonify | |
| import requests | |
| import numpy as np | |
| import pandas as pd | |
| from sklearn.linear_model import LinearRegression | |
| from flask import Flask, render_template, request | |
| from sklearn.model_selection import train_test_split | |
| #--------------------------------------------------------------------- | |
| # Example configuration for a possible web application. See the | |
| # full configuration options online. | |
| # | |
| # https://www.haproxy.org/download/1.8/doc/configuration.txt | |
| # | |
| #--------------------------------------------------------------------- | |
| #--------------------------------------------------------------------- | |
| # Global settings |
| - hosts: proxyserver | |
| tasks: | |
| - name: installing haproxy program | |
| package: | |
| name: haproxy | |
| - name: configuring hapoxy | |
| template: | |
| dest: /etc/haproxy/haproxy.cfg |