I have a pandas dataframe
in which I have 1300 brain parts with 21 columns of information about them. In there is a structure_id_path
, a tree-like structure of brain regions.
I want to find every structure_id_path that contains e.g. '315' in it.
import pandas as pd
import numpy as np
df = pd.read_csv('/home/anja/Schreibtisch/Master/vonIsa/structure_tree_safe_2017.csv')
df[df.structure_id_path == '/997/8/567/688/695/315/184/526157192/']
When I do it like that I find exactly that one brain part with that specific structure_id_path
.
But if I want to find every structure_id_path
that contains 315
, it returns an empty dataFrame, because it can't find 315.
isocortex = '315'
x = structure_list[structure_list['structure_id_path'] == isocortex]
Is there a method to find it, like *315 ?