I have a directory where csv files are located. The code reads the files and creates histograms based on the data in the files.
However, I am trying to make it so that at the command line, I can enter one of the column headers in the csv file and the code will only make a graph of the specified command. Example: python histogram_maker.py "C:/Folder" Area.
I was able to do that, but I want to add a part that would create an error message in case the user enters a command that is not specified in the csv file. Example: Perimeter does not exist. How can I do that?
for column in df:
os.chdir(directory)
if len(sys.argv)>2:
for x in arguments:
if x.endswith(column):
# code to make histogram
Need part that would say if x.endswith(column) not there error message should appear.