Jun-10-2022, 08:04 PM
My program adds rows to a dataframe by using .append() with a dictionary. In order to make this work, I think I had to do df = df.append() rather than just df.append(). Going back and retrying this afternoon, though, I think I've seen it work either way?
Here, though:
What's going on with when and why .append() may or may not require assignment (for lists vs. dataframes) in order to work?
Here, though:
colors = [] for i in summary_results['ROI%']: if i < 0: colors = colors.append('r') else: colors = colors.append('g') print(colors)I get AttributeError: 'NoneType' object has no attribute 'append' . I need just colors.append('r') rather than assignment.
What's going on with when and why .append() may or may not require assignment (for lists vs. dataframes) in order to work?