Let's say I have multiple CSV files which all have their x and y coordinates start from row 15 in their own columns of 1 and 2. I just want to run through all the CSV files in a folder running this script and just plotting x and y.
My idea so far is using glob in the current directory and importing panda so that I may be able to use ".read_csv".
However, I'm not too sure on how to set up the for loop which will be required to run through all the .csv files
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
headers = ['x', 'y']
df = pd.read_csv('C:\Users\User1\Downloads\DataLog.CSV',names=headers)
print (df)
# plot
plt.plot(x,y)
plt.show()
That's what I have so far just to get it working on a single file. However, running this yields an error.
(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape