{"id":131,"date":"2021-02-26T14:39:49","date_gmt":"2021-02-26T14:39:49","guid":{"rendered":"https:\/\/streetmindfood.com\/plutohash\/?p=131"},"modified":"2021-04-25T20:09:56","modified_gmt":"2021-04-25T20:09:56","slug":"daily-average-fee-by-year-in-usd","status":"publish","type":"post","link":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/","title":{"rendered":"Daily average Fee by year in USD"},"content":{"rendered":"\n

In this post we’ll see how it’s possible, with just a few lines in Python, to analyze how the average daily cost of fees changes over time, from one year to the next but also from one month to the next. As a reminder, we are analyzing the bitcoin blockchain.<\/p>\n\n\n\n

Let’s start by importing the libraries.<\/p>\n\n\n\n

import blocksci\nimport pandas as pd\nimport seaborn\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker\nimport collections\nimport numpy as np\n%matplotlib notebook<\/code><\/pre>\n\n\n\n

Instantiate the chain object:<\/p>\n\n\n\n

chain = blocksci.Blockchain(\"\/BlockSci\/config_file\")<\/code><\/pre>\n\n\n\n

We also use converter <\/code>to express the value of fees in USD. Exchange rates are provided by CoinDesk.<\/p>\n\n\n\n

converter = blocksci.CurrencyConverter()<\/code><\/pre>\n\n\n\n

We use the fees_by_year()<\/code> function to define the year of interest and then be able to apply it to different years. This is the code:<\/p>\n\n\n\n

def fees_by_year(year):\n    \n    blocks = chain.range(year)\n    fees = blocks.fee \/ blocks.tx_count\n    times = blocks.time\n    \n    df = pd.DataFrame({\"Fee\":fees}, index = times)\n    df = converter.satoshi_to_currency_df(df, chain)\n    ax = df.resample(\"d\").mean().plot(legend=False)\n    \n    return df, ax <\/code><\/pre>\n\n\n\n

Now, we can apply the function by defining the year of our interest. Let’s try the years 2017, 2019, and 2020.<\/p>\n\n\n\n

df_2017,ax_2017 = fees_by_year(\"2017\") <\/code><\/pre>\n\n\n\n
\"\"<\/figure>\n\n\n\n
df_2019,ax_2019 = fees_by_year(\"2019\") <\/code><\/pre>\n\n\n\n
\"\"<\/figure>\n\n\n\n
df_2020,ax_2020 = fees_by_year(\"2020\") <\/code><\/pre>\n\n\n\n
\"\"<\/figure>\n\n\n\n

From the chart we can see that the average fee per transaction in 2019 has remained essentially stable. On the other hand, if we look at 2017, there has been a noticeable increase in the last few months. The reason for this is easy to guess, because as we know there was a significant growth in the popularity of bitcoin in 2017, this meant more purchases and an increase in competition for transaction validation. As we can see something similar happened in the last months of 2020.<\/p>\n\n\n\n

Would you like to analyze the bitcoin blockchain using Python?<\/p>\n\n\n\n

Apply to our Beta Tester Program<\/strong>!<\/a><\/p>\n\n\n\n

You can also join our <\/a>developer channel<\/a>!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

In this post we’ll see how it’s possible, with just a few lines in Python, to analyze how the average daily cost of fees changes over time, from one year to the next but also from one month to the next. As a reminder, we are analyzing the bitcoin blockchain. Let’s start by importing the …<\/p>\n

Daily average Fee by year in USD<\/span> Read More »<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[5],"tags":[11,9,10,12,14,13,19],"yoast_head":"\nDaily average Fee by year in USD - PlutoHash<\/title>\n<meta name=\"description\" content=\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Daily average Fee by year in USD - PlutoHash\" \/>\n<meta property=\"og:description\" content=\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/\" \/>\n<meta property=\"og:site_name\" content=\"PlutoHash\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PlutoHashcom\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-26T14:39:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-25T20:09:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@plutohashcom\" \/>\n<meta name=\"twitter:site\" content=\"@plutohashcom\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Francesco Zedde\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.plutohash.com\/#organization\",\"name\":\"Plutohash\",\"url\":\"https:\/\/www.plutohash.com\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/PlutoHashcom\/\",\"https:\/\/www.instagram.com\/plutohashcom\/\",\"https:\/\/www.linkedin.com\/company\/plutohash\/?viewAsMember=true\",\"https:\/\/www.youtube.com\/channel\/UC2P2z4wHTCeH1PbPXU70F0w\",\"https:\/\/twitter.com\/plutohashcom\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.plutohash.com\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1\",\"width\":657,\"height\":746,\"caption\":\"Plutohash\"},\"image\":{\"@id\":\"https:\/\/www.plutohash.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.plutohash.com\/#website\",\"url\":\"https:\/\/www.plutohash.com\/\",\"name\":\"PlutoHash\",\"description\":\"Empowering Talents Worldwide\",\"publisher\":{\"@id\":\"https:\/\/www.plutohash.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.plutohash.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg\",\"contentUrl\":\"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage\",\"url\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/\",\"name\":\"Daily average Fee by year in USD - PlutoHash\",\"isPartOf\":{\"@id\":\"https:\/\/www.plutohash.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage\"},\"datePublished\":\"2021-02-26T14:39:49+00:00\",\"dateModified\":\"2021-04-25T20:09:56+00:00\",\"description\":\"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.\",\"breadcrumb\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.plutohash.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Daily average Fee by year in USD\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.plutohash.com\/#\/schema\/person\/f4b24da149e25ea2c3411b565664a45d\"},\"headline\":\"Daily average Fee by year in USD\",\"datePublished\":\"2021-02-26T14:39:49+00:00\",\"dateModified\":\"2021-04-25T20:09:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage\"},\"wordCount\":235,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.plutohash.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg\",\"keywords\":[\"analysis\",\"bitcoin\",\"blockchain\",\"datascience\",\"programming\",\"python\",\"tutorial\"],\"articleSection\":[\"PlutoHash Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.plutohash.com\/#\/schema\/person\/f4b24da149e25ea2c3411b565664a45d\",\"name\":\"Francesco Zedde\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.plutohash.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/011c5e59cb8321e86b6a18e6d52601b2?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/0.gravatar.com\/avatar\/011c5e59cb8321e86b6a18e6d52601b2?s=96&d=mm&r=g\",\"caption\":\"Francesco Zedde\"},\"url\":\"http:\/\/www.plutohash.com\/author\/francescozedde\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Daily average Fee by year in USD - PlutoHash","description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/","og_locale":"en_US","og_type":"article","og_title":"Daily average Fee by year in USD - PlutoHash","og_description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","og_url":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/","og_site_name":"PlutoHash","article_publisher":"https:\/\/www.facebook.com\/PlutoHashcom\/","article_published_time":"2021-02-26T14:39:49+00:00","article_modified_time":"2021-04-25T20:09:56+00:00","og_image":[{"url":"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg"}],"twitter_card":"summary_large_image","twitter_creator":"@plutohashcom","twitter_site":"@plutohashcom","twitter_misc":{"Written by":"Francesco Zedde","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.plutohash.com\/#organization","name":"Plutohash","url":"https:\/\/www.plutohash.com\/","sameAs":["https:\/\/www.facebook.com\/PlutoHashcom\/","https:\/\/www.instagram.com\/plutohashcom\/","https:\/\/www.linkedin.com\/company\/plutohash\/?viewAsMember=true","https:\/\/www.youtube.com\/channel\/UC2P2z4wHTCeH1PbPXU70F0w","https:\/\/twitter.com\/plutohashcom"],"logo":{"@type":"ImageObject","@id":"https:\/\/www.plutohash.com\/#logo","inLanguage":"en-US","url":"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.plutohash.com\/wp-content\/uploads\/2021\/05\/Logo-plutohash.jpg?fit=657%2C746&ssl=1","width":657,"height":746,"caption":"Plutohash"},"image":{"@id":"https:\/\/www.plutohash.com\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.plutohash.com\/#website","url":"https:\/\/www.plutohash.com\/","name":"PlutoHash","description":"Empowering Talents Worldwide","publisher":{"@id":"https:\/\/www.plutohash.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.plutohash.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage","inLanguage":"en-US","url":"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg","contentUrl":"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg"},{"@type":"WebPage","@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage","url":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/","name":"Daily average Fee by year in USD - PlutoHash","isPartOf":{"@id":"https:\/\/www.plutohash.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage"},"datePublished":"2021-02-26T14:39:49+00:00","dateModified":"2021-04-25T20:09:56+00:00","description":"Plutohash is a startup focused on blockchain analytics. We offer practical solutions to perform analytics on blockchain data parsed and ready to be analyzed with friendly tools for data scientists, as Jupyter Notebook and Python language.","breadcrumb":{"@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.plutohash.com\/"},{"@type":"ListItem","position":2,"name":"Daily average Fee by year in USD"}]},{"@type":"Article","@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#article","isPartOf":{"@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage"},"author":{"@id":"https:\/\/www.plutohash.com\/#\/schema\/person\/f4b24da149e25ea2c3411b565664a45d"},"headline":"Daily average Fee by year in USD","datePublished":"2021-02-26T14:39:49+00:00","dateModified":"2021-04-25T20:09:56+00:00","mainEntityOfPage":{"@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#webpage"},"wordCount":235,"commentCount":0,"publisher":{"@id":"https:\/\/www.plutohash.com\/#organization"},"image":{"@id":"http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#primaryimage"},"thumbnailUrl":"https:\/\/streetmindfood.com\/plutohash\/wp-content\/uploads\/2021\/03\/fees_by_year_2017.jpg","keywords":["analysis","bitcoin","blockchain","datascience","programming","python","tutorial"],"articleSection":["PlutoHash Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.plutohash.com\/2021\/02\/26\/daily-average-fee-by-year-in-usd\/#respond"]}]},{"@type":"Person","@id":"https:\/\/www.plutohash.com\/#\/schema\/person\/f4b24da149e25ea2c3411b565664a45d","name":"Francesco Zedde","image":{"@type":"ImageObject","@id":"https:\/\/www.plutohash.com\/#personlogo","inLanguage":"en-US","url":"http:\/\/0.gravatar.com\/avatar\/011c5e59cb8321e86b6a18e6d52601b2?s=96&d=mm&r=g","contentUrl":"http:\/\/0.gravatar.com\/avatar\/011c5e59cb8321e86b6a18e6d52601b2?s=96&d=mm&r=g","caption":"Francesco Zedde"},"url":"http:\/\/www.plutohash.com\/author\/francescozedde\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/131"}],"collection":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":1,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":135,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/posts\/131\/revisions\/135"}],"wp:attachment":[{"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.plutohash.com\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}