How to find mean of a numpy array?
Well, if it says that sata is not defined, you are most likely not opening the file properly. My guess is that you are not in the proper folder path. Use the package os to find your current working folder and change to the appropriate folder. The function os.getcwd() will show you in which folder you are and os.chdir("your/target/folder") will lead you to the appropriate folder. Alternatively, instead of passing only the file name to np.genfromtxtyou can pass the full path.
Also, unless you have missing values (NaN) in your dataset, you should probably use the regular np.mean instead of np.nanmean.
I am trying to find the mean of each column, across all rows, given a set of data. I've opened the csv file using sata = np.genfromtxt('movieRatingsDeidentified.csv',delimiter=','), and am currently trying to find the mean of each column across all rows using D1 = numpy.nanmean(sata,axis=0)however I'm getting an error message saying that sata is not defined, and is also not showing up in my variable explorer. It's incredibly frustrating as I have relatively little experience in programming and have only started using Spyder a few weeks ago.