Hi everyone.
I had a problem while trying to create muliple datasets from multiple CSVs. I replaced the single CSV names for a variable, so when i create a dataset, I can use different CSVs as asrguments in order to crearte different datasets. The start of my code is:
class Dataset(DGLDataset):
def init(self, nodes, relations):
super().init(name=‘i2b2_dataset’)
self.nodes = nodes
self.relations = relations
def process(self):
nodes_data = pd.read_csv(nodes)
edges_data = pd.read_csv(relations)
So when i call the class I can create different datasets with it:
dataset_1 = Dataset(nodes=‘nodes_1.csv’, relations=‘relations_2.csv’)
dataset_2 = Dataset(nodes=‘nodes_2.csv’, relations=‘relations_2".csv’)
The problem is this “nodes” and “relations” variables from the “process()” function are not declared and I get: “NameError: name ‘nodes’ is not defined”
How and where should I declare them?
Thank you so much.