Skip to content

running command error #2

Open
Open
@scatyf3

Description

@scatyf3

Hello, I am a newcomer learning python and data science, I don't know if this question is relatively simple and stupid, but I found that the running command of this code is incorrect.

➜  apriori_python git:(master) ✗ ls                               
__init__.py apriori.py  utils.py
➜  apriori_python git:(master) ✗ python3 apriori.py -f dataset.csv
Traceback (most recent call last):
  File "/Users/juanitahowe/Documents/GitHub/apriori_python/apriori_python/apriori.py", line 87, in <module>
    freqItemSet, rules = aprioriFromFile(options.inputFile, options.minSup, options.minConf)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/juanitahowe/Documents/GitHub/apriori_python/apriori_python/apriori.py", line 38, in aprioriFromFile
    C1ItemSet, itemSetList = getFromFile(fname)
                             ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/apriori_python/utils.py", line 32, in getFromFile
    with open(fname, 'r') as file:
         ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dataset.csv'
➜  apriori_python git:(master) ✗ python3 apriori.py -f tesco2.csv -s 0.5 -c 0.5
Traceback (most recent call last):
  File "/Users/juanitahowe/Documents/GitHub/apriori_python/apriori_python/apriori.py", line 87, in <module>
    freqItemSet, rules = aprioriFromFile(options.inputFile, options.minSup, options.minConf)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/juanitahowe/Documents/GitHub/apriori_python/apriori_python/apriori.py", line 38, in aprioriFromFile
    C1ItemSet, itemSetList = getFromFile(fname)
                             ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/apriori_python/utils.py", line 32, in getFromFile
    with open(fname, 'r') as file:
         ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'tesco2.csv'

To run program with specific dataset, I think this is the correct command

➜  apriori_python git:(master) ✗ python3 apriori.py -f ../dataset/tesco2.csv -s 0.5 -c 0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions