Skip to content

Instantly share code, notes, and snippets.

%macro Calculs_Trimestriels(trimestre);
/* Début de la macro */
/* Extraction des informations nécessaires de la table */
data TempData;
set NOM_TABLE;
format DateDepot datetime27.6;
trimestre_date = intnx('quarter', input(put(&trimestre., yymmn6.), yymmn6.), 0, 'b');
run;
import os
import psutil
def get_files_in_use(directory):
files_in_use = set()
# Iterate through all files in the directory and its subdirectories
for root, dirs, files in os.walk(directory):
for file in files:
file_path = os.path.join(root, file)
@hdary85
hdary85 / Diflib.py
Last active December 6, 2023 08:12
import pandas as pd
from difflib import SequenceMatcher
import csv
import re
# Charger le fichier CSV dans un dataframe
df = pd.read_csv('votre_fichier.csv')
# Charger le fichier texte
with open('votre_fichier.txt', 'r', encoding='utf-8') as file:
@hdary85
hdary85 / Nlp.py
Last active December 6, 2023 07:18
Nlp.py
import pandas as pd
import spacy
# Charger le modèle spaCy pour le traitement du langage naturel (fr_core_news_sm est un modèle léger pour le français)
nlp = spacy.load('fr_core_news_sm')
# Charger le fichier CSV dans un dataframe
df = pd.read_csv('votre_fichier.csv')
# Charger le fichier texte
data resultats;
set votre_table;
array colonnes[*] col1-col20;
terme1_present = 0;
terme2_present = 0;
terme3_present = 0;
do i = 1 to dim(colonnes);
@hdary85
hdary85 / COMBI.PY
Last active December 1, 2023 21:18
# Liste de tous les produits uniques
all_products = set(df['PRODUIT'])
# Grouper les produits achetés par CLIENT
grouped = df.groupby('CLIENT')['PRODUIT'].apply(set)
# Générer toutes les combinaisons de 3 à 5 produits
unique_combos = []
used_products = set()
@hdary85
hdary85 / gui22
Created November 30, 2023 04:26
import tkinter as tk
from tkinter import simpledialog, messagebox
class NestedDictManager:
def __init__(self, root, data):
self.root = root
self.root.title("Nested Dictionary Manager")
self.data = data # Use the provided dictionary
self.tree = tk.ttk.Treeview(self.root)
import tkinter as tk
from tkinter import simpledialog, messagebox
class NestedDictManager:
def __init__(self, root, data):
self.root = root
self.root.title("Nested Dictionary Manager")
self.data = data # Use the provided dictionary
self.tree = tk.ttk.Treeview(self.root)
import tkinter as tk
from tkinter import simpledialog, messagebox
class NestedDictManager:
def __init__(self, root):
self.root = root
self.root.title("Nested Dictionary Manager")
self.data = {
'key1': 'value1',
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 29 15:02:06 2023
@author: Lenovo
"""
nested_dict = {
'rule1': {
'name': 'xy1z11111',
'Reccurence': {