help me here: Command failed with error: Traceback (most recent call last): File…
- User
help me here:
Command failed with error: Traceback (most recent call last): File "/home/alejandro/Documents/projects/hiller/champagne/pisco/modules/job.py", line 195, in main() File "/home/alejandro/Documents/projects/hiller/champagne/pisco/modules/job.py", line 189, in main (df, chains, seqs, chromsizes, species) = load_files(args) ^^^^^^^^^^^^^^^^ File "/home/alejandro/Documents/projects/hiller/champagne/pisco/modules/job.py", line 157, in load_files gene = df.loc[0, "gene"] ^^^^^^ AttributeError: 'NoneType' object has no attribute 'loc'
def load_line(line: str) -> pd.DataFrame: """ Load gene line from database
codeParameters ---------- line : str Gene line from database. Returns ------- pd.DataFrame Example ------- >>> load_line('ENSG00000223972.5,chr1,123,256,124,chr9') """ pd.DataFrame(line.split("/n")[1].split(","), index=line.split("/n")[0].split(",")).Tdef load_files(args: argparse.Namespace) -> Tuple[ pd.DataFrame, dict, dict, dict, List[str] ]: species = args.species.split(",") ref = species[0] df = load_line(args.line) gene = df.loc[0, "gene"]
codelog( "INFO: Loading chains, sequences and chromosome sizes...", Const.LOGS.joinpath("genes", f"{gene}.log"), ) - Assistant
The error message you're encountering indicates that your variable is of type , which means that when the function is supposed to return a DataFrame, it's returning instead. Consequently, when you try to access the attribute on , it fails because objects don't have such an attribute.