@classmethod<EOL><INDENT>def from_df(cls, df, **kwargs):<DEDENT>
tree = cls(**kwargs)<EOL>for (n,b), g in df.groupby(['<STR_LIT:name>','<STR_LIT>']):<EOL><INDENT>sources = [Source(**s[['<STR_LIT>','<STR_LIT>','<STR_LIT>','<STR_LIT>','<STR_LIT>']])<EOL>for _,s in g.iterrows()]<EOL>obs = Observation(n, b, g.resolution.mean(),<EOL>sources=sources, relative=g.relative.any())<EOL>tree.add_observation(obs)<EOL><DEDENT>return tree<EOL>
DataFrame must have the right columns.

these are: name, band, resolution, mag, e_mag, separation, pa