I need to explain more clearly because from the title you can't completely comprehend my needs...
File = input ("Insert the name of the file: ")
IV = np.genfromtxt('D:\User\Python\Programms_Python\programms\%d.txt',
File, usecols=(1,5,2,5))
I need to insert from command line the name of the file I want to analyze, because I have to do multiple analyses on many different .txt
files and inserting their names directly from the command line would make my job much faster. Can you suggest a way to insert it inside the function genfromtxt
? Is it possible?
genfromtxt is a function inside numpy and it allows you to copy the values of a column in your txt inside an array, using usecols you can ask which column to copy in the array which this way can become a multidimensional array, like in this case IV is a four dimensional array.
Trying the way I showed above, genfromtxt
doesn't recognize the %d -> File
(the names of the .txt
files are just numbers and I tried also with %s
but it didn't change) so please.. HELP