Sunburst chart with a continuous colorscale

I am trying to recreate the sample in Sunburst charts in Python, but Process finished with exit code 1.

The following is generated when ran:
Traceback (most recent call last):

  • File “/home/mbolanosd/PycharmProjects/pythonProject1/”, line 42, in *
  • df_all_trees = build_hierarchical_dataframe(df, levels, value_column, color_columns)*
  •               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
  • File “/home/mbolanosd/PycharmProjects/pythonProject1/”, line 34, in build_hierarchical_dataframe*
  • df_all_trees = df_all_trees.append(df_tree, ignore_index=True)*
  •               ^^^^^^^^^^^^^^^^^^^*
  • File “/home/mbolanosd/.virtualenvs/pythonProjectGraphs/lib/python3.11/site-packages/pandas/core/”, line 6204, in getattr*
  • return object.getattribute(self, name)*
  •       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*

AttributeError: ‘DataFrame’ object has no attribute ‘append’. Did you mean: ‘_append’?

As I am a novice in Python and using Pycharm as IDE, cannot make sense of how to fix the code for the example to work.