file processing

i have stock.dat file ( two columns of stocks) and i created the program to read from this file and display two columns of stocks, but i cant figure out how to get the average of each stocks. actually i have two arrays of stocks with size 20, but when i try to create a function to compute the average i get incorrect answer. i would be gratitude if you help me with this problem

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.