In your example code there is a variable-name-typo (results in an Exception; Attribute
vs Attibute
, but after that's fixed there's still some things to explain.
"""
in path FP
out Attribute s
"""
import geopandas as gpd
import pandas as pd
import fiona
import numpy as np
gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'
# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
value = [gi['features'][features]['properties'][variableAttribute]]
Attribute.append(value)
If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.
Usually this will be enough to show the error/exception right beside the node in the nodeview.
Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like
[["D:\my_file.txt"]]
in that case your gpd.read_file function line should read something like
gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")