ISL-4698 Fixed python script so it reads provided data properly
This commit is contained in:
		@@ -5,7 +5,7 @@
 | 
				
			|||||||
# Sample function created for demonstration of creating custom applications functionality
 | 
					# Sample function created for demonstration of creating custom applications functionality
 | 
				
			||||||
# See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications
 | 
					# See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from numpy import loadtxt
 | 
					import numpy as np
 | 
				
			||||||
import matplotlib.pyplot as plt
 | 
					import matplotlib.pyplot as plt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main(numbers_file, multiplier):
 | 
					def main(numbers_file, multiplier):
 | 
				
			||||||
@@ -20,7 +20,9 @@ def main(numbers_file, multiplier):
 | 
				
			|||||||
        numbers.
 | 
					        numbers.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    numbers = loadtxt(numbers_file, comments="#", delimiter=",", unpack=False)
 | 
					    numbers = np.genfromtxt(numbers_file, comments="#", delimiter=",", unpack=False)
 | 
				
			||||||
 | 
					    numbers = numbers[~np.isnan(numbers)]
 | 
				
			||||||
 | 
					    numbers = np.array(numbers).flatten()
 | 
				
			||||||
    multiplied_numbers = numbers * multiplier
 | 
					    multiplied_numbers = numbers * multiplier
 | 
				
			||||||
    plt.figure()
 | 
					    plt.figure()
 | 
				
			||||||
    plt.plot(multiplied_numbers)
 | 
					    plt.plot(multiplied_numbers)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user