07-22-2021 06:57 PM
I used LabVIEW to create the GUI for to app I am working on and wrote a code in python for LabVIEW to call. I did some small tests to check if it was working before I wrote the code, but I had to import pandas and scipy while developing the code, and LV was working fine until I tried to import a .csv file in the python code. I'm just wondering if this is an installation problem or if the error is because I'm trying to read a .csv file in a python script called from labview.
I've tried 3.6, 3.6.3, and 3.6.8 and have had the same issue with all versions.
07-22-2021 09:30 PM
Does labview work with pandas
07-23-2021 08:07 AM
Have you tried performing some simple file I/O to test if there are any permissions errors or something like that? I wrote a simple function to test using the math package:
Perhaps try using a try-except block to see where the error is coming from.
This article shows an example of how to call the NumPy package. The most interesting thing here is that at the bottom it states, "This article does not guarantee all functions in the NumPy package are supported by LabVIEW Python Node." I wonder why...
07-23-2021 09:52 AM
Yeah I have it to where it can perform simple opperations like importing a value from labview, create a dataframe, take the standard deviation using pandas, and export the std to labview.
The error comes when I try to import a .csv file into python. I'm hoping there is a work around, because I've been working on this project for almost a year and this is literally the last part.
07-25-2021 11:43 AM
I don't know how to return a pandas dataframe via python node to LabView
but reading a csv via pandas within the python node doesn't throw any errors
07-26-2021 06:39 AM
ok, there appears to be an issue with reading csv files with numpy's loadtxt within the python node - maybe this is related to the original topic
the following code generates a file.csv in the same directory as labview.vi and script.py -
further more the code then uses the python node to open this csv and return it as 2d array of strings
the python node spits out error 1672 - which is very generic
if the script.py is executed in a python IDE, it will execute successfully and return the array size
(10, 2)