def visit_Subscript(self, node: ast.Subscript): column_name = _it_column(node) if column_name is None or not column_name.strip(): raise ValueError("Name of the column cannot be None or empty.") if column_name not in self.df.columns: raise ValueError( f"The column {column_name} is not present in the dataframe")
def visit_Attribute(self, node: ast.Attribute): column_name = _it_column(node) if column_name not in self.df.columns: raise ValueError( f"The column {column_name} is not present in the dataframe")
def visit_Subscript(self, node: ast.Subscript): self.accessed.add(_it_column(node))
def visit_Attribute(self, node: ast.Attribute): self.accessed.add(_it_column(node))
def visit_Subscript(self, node: ast.Subscript): column_name = _it_column(node) self.result = self.df[column_name]
def visit_Attribute(self, node: ast.Attribute): column_name = _it_column(node) self.result = self.df[column_name]
def visit_Subscript(self, node: ast.Subscript): column_name = _it_column(node) self.result = col(column_name) # type: ignore
def visit_Attribute(self, node: ast.Attribute): column_name = _it_column(node) self.result = col(column_name) # type: ignore