From 5feb785439595bff906bf31bcbf69aa850ecc42d Mon Sep 17 00:00:00 2001 From: ymlesni Date: Fri, 29 Mar 2024 11:13:59 +0100 Subject: [PATCH] Update sample_app.py --- sample_app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sample_app.py b/sample_app.py index 4beb718..794eb1f 100644 --- a/sample_app.py +++ b/sample_app.py @@ -5,7 +5,7 @@ # Sample function created for demonstration of creating custom applications functionality # See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications -from numpy import genfromtxt +import numpy as np import matplotlib.pyplot as plt def main(numbers_file, multiplier): @@ -20,7 +20,9 @@ def main(numbers_file, multiplier): numbers. """ - numbers = genfromtxt(numbers_file, comments="#", delimiter=",", unpack=False)[:,:-1] + numbers = np.genfromtxt(numbers_file, comments="#", delimiter=",", unpack=False) + numbers = numbers[~np.isnan(numbers)] + numbers = np.array(numbers).flatten() multiplied_numbers = numbers * multiplier plt.figure() plt.plot(multiplied_numbers)