This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2023 Chris Pearce | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!pip install mlxtend | |
import pandas as pd | |
import csv | |
from mlxtend.preprocessing import TransactionEncoder | |
from mlxtend.frequent_patterns import apriori | |
def csv_to_tabular(csv_path): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
def csv_lines(csv_path_name): | |
with open(csv_path_name) as csv_file: | |
reader = csv.reader(csv_file) | |
for row in reader: | |
# Drop empty values | |
yield [value for value in row if value] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import json | |
import sys | |
skipList = [ | |
"BaseThreadInitThunk", | |
"CharPrevA", | |
"CsrAllocateMessagePointer", | |
"DispatchMessageW", | |
"DispatchMessageWorker", |