I have imported data from Yfinance using
historicaldata = pdr.get_data_yahoo(tickers, period='1mo', interval='5m', prepost=True, group_by='ticker')
historicaldata.to_csv('./store/historicaldata.csv')
which creates the following csv
What I now want to do is pull in the "M6A=F" & "Volume" column and do a sum on the total volume but I am running into a problem trying to get at that column from the csv file using pandas.
If I try to load the columns back in using
voldata=pd.read_csv('./store/historicaldata.csv', usecols=['M6A=F'])
voldata.to_csv('volumetest.csv')
it only brings in the first "M6A=F" column it finds (the one with "Open" in the second row in the previous image) and no amount of filtering attempts helped me get to the M6A=F volume column.
So I did a test output using
voldata=pd.read_csv('./store/historicaldata.csv')
voldata.to_csv('volumetest.csv')
And discovered it creates the following csv where it has changed all the columns to unique data which makes me think it does that when loading it in using pd.read_csv.
(incidentally, I need to do this from the csv to avoid repeatedly pulling large amounts off yfinance every time I want to work on historical data)
What is the correct way for me to get at the "M6A=F" "Volume" column from a csv?

