![]() It is formatted like this: # TitleĪll of the above settings are enabled in this post, so you can see what they look like! Front matter is metadata that can turn on/off options in your Notebook. The first cell in your Jupyter Notebook or markdown blog post contains front matter. fast_template may be a better option for getting folks blogging who have no technical expertise at all, and will only be creating posts using Github's integrated online editor. Infact, this blog post is written in a Jupyter notebook, which you can see with the "View on GitHub" link above.įast.ai have previously released a similar project called fast_template, which is even easier to set up, but does not support automatic creation of posts from Microsoft Word or Jupyter notebooks, including many of the features outlined above.īecause fastpages is more flexible and extensible, we recommend using it where possible. All you have to do is save your Jupyter notebook, Word document or markdown file into a specified directory and the rest happens automatically. ![]() Due to built-in automation of fastpages, you don't have to fuss with conversion scripts. The setup takes around three minutes, and does not require any technical knowledge or expertise. Categorization of blog posts by user-supplied tags for discoverability.įastpages relies on Github pages for hosting, and Github Actions to automate the creation of your blog.Embed Twitter cards and YouTube videos.Create and edit Markdown posts entirely online using GitHub's built-in markdown editor.Create posts, including formatting and images, directly from Microsoft Word documents.Ability to add links to Colab and GitHub automatically.Define the Title, Summary and other metadata via a special markdown cells.Collapsable code cells that are either open or closed by default.Interactive visualizations made with Altair remain interactive.Create posts containing code, outputs of code (which can be interactive), formatted text, etc directly from Jupyter Notebooks for instance see this great example post from Scott Hawley.fastpages is a platform which allows you to create and host a blog for free, with no ads and many useful features, such as: I've also added a tooltip to display the hours and the number of cities, though it cannot be discerned from the static picture below.We are very pleased to announce the immediate availability of fastpages. ![]() And we are coloring each state by the number of cities it has in the dataset. In the code above, we are sorting the States (on Y-axis) by the measure we are plotting, which is the average of the hours per month to afford a home. Tooltip = ,Ĭolor = alt.Color('count(*):Q', legend=alt.Legend(title='Number of Cities')) Let's plot the average hours per month to afford a home for each state (each row is a City, so need to aggregate the measure at State level)Īlt.X('average(Hours per Month to Afford a Home):Q', title='Avg Hours per Month to Afford a Home'),Īlt.Y('State:N', sort=alt.EncodingSortField(field='Hours per Month to Afford a Home', op="mean",order='descending')), The dataset we will be using is called - Hours Americans Need to Work to Pay Mortgage ( )ĭata = pd.read_excel(r'Hours to Pay Mortgage.xlsx', sheet_name=r'Sheet1') With this brief prologue to the bar charts, let's jump into creating bar charts using Altair. However, when the category names are long, horizontal bar graphs are our friend. Even in the case of non-ordinal categories, when the category names are short enough, we can use column charts. Because it is easier to understand the pattern when seen from left to right rather than from top to bottom. For example, High/Medium/Low, Q1/Q2/Q3/Q4 etc. While both Horizontal Bar Chart and Column Chart are suitable for depicting categorical breakdown of a measure, each is best suited for a slightly different use case.Ĭolumn chart is usually preferred when the categories are ordinal in nature. If the categories are on X-axis, it is usually called the column chart instead, as the height of the bars (columns) depict the numeric metric we are interested in. One of the simplest and most common chart to visualize categorical data is Bar Chart.
0 Comments
Leave a Reply. |