<jupyter_start><jupyter_text>![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true)  Household Budget Visualization Can we get a better understanding of our monthly household budget?Let's try out [sunburst charts](https://plotly.com/python/sunburst-charts) and [treemaps](https://plotly.com/python/treemaps) for visualizing money that comes in and goes out.This first code cell creates a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) file. Feel free to edit the categories and amounts and add or remove lines.Then `►Run` the cell to create the file.<jupyter_code>%%writefile budget.csv
InOut,Category,Label,Amount
Income,Job,Restaurant,2500
Income,Job,Delivery,500
Income,Investment,Dividends,100
Expense,Food,Groceries,200
Expense,Food,Restaurants,100
Expense,Home,Water & Waste,100
Expense,Home,Energy,150
Expense,Home,Insurance,100
Expense,Home,Property Tax,75
Expense,Home,Data,100
Expense,Entertainment,Streaming,25
Expense,Entertainment,Toys,50
Expense,Transportation,Insurance,75
Expense,Transportation,Fuel,50
Expense,Donations,Charity,300
Expense,Home,Mortgage,1000
Expense,Investment,TFSA,500
Expense,Investment,RRSP,100<jupyter_output><empty_output><jupyter_text>Now that we have a file containing our budget information, let's create some visualizations.<jupyter_code>import pandas as pd
budget = pd.read_csv('budget.csv')
import plotly.express as px
px.sunburst(budget, path=['InOut', 'Category', 'Label'], values='Amount', color='Category', title='Budget Sunburst').show()
px.treemap(budget, path=['InOut', 'Category', 'Label'], values='Amount', color='Category', title='Budget Treemap').show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12420197330237957, 'fraction_numerical': 0.02959953569355775, 'mean_word_length': 9.385542168674698, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '83788', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 618, 'n_tokens_neox': 566, 'n_words': 118, 'path': 'notebooks/budget-visualization.ipynb', 'repo_name': 'callysto/interesting-problems', 'size': '1723'}