Update sample_app.py

This commit is contained in:
ymlesni 2024-03-29 11:13:59 +01:00
parent 80d592b6ce
commit 5feb785439
1 changed files with 4 additions and 2 deletions

View File

@ -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)