Try running it as:
python getData.py ../data
The presence of sys.argv[1]
means the program cannot be run without passing at least one command line argument.
As documented in the python documentation sys.argv
is a list of command line arguments with the first entry sys.argv[0]
being the script name. The ÌndexError
exception occurs when no command line arguments are passed as the code is trying to access a none existent entry.