{"id":119,"date":"2021-02-26T14:30:25","date_gmt":"2021-02-26T14:30:25","guid":{"rendered":"https:\/\/streetmindfood.com\/plutohash\/?p=119"},"modified":"2021-05-14T09:58:03","modified_gmt":"2021-05-14T09:58:03","slug":"explore-transaction-fees-in-a-specific-block","status":"publish","type":"post","link":"http:\/\/www.plutohash.com\/2021\/02\/26\/explore-transaction-fees-in-a-specific-block\/","title":{"rendered":"Explore Transaction Fees in a specific Block"},"content":{"rendered":"\n
In this simple tutorial we will see how you can observe the fees paid in a specific block by knowing the location of the block in the blockchain.<\/p>\n\n\n\n
We start by importing the We import the pandas library to store the data in a Now we select a specific block, in our case block 465100, and store the data regarding the fees of each transaction in a DataFrame.<\/p>\n\n\n\n This should be the result:<\/p>\n\n\n\n Well, we can now set up the graph and display it.<\/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 simple tutorial we will see how you can observe the fees paid in a specific block by knowing the location of the block in the blockchain. We start by importing the blocksci library and instantiating the blockchain. We import the pandas library to store the data in a pandas.DataFrame, and the seaborn library …<\/p>\nblocksci <\/code>library and instantiating the blockchain.<\/p>\n\n\n\n
import blocksci\nchain = blocksci.Blockchain(\"\/BlockSci\/config_file\")<\/code><\/pre>\n\n\n\n
pandas.DataFrame<\/code>, and the
seaborn <\/code>library to display the data.<\/p>\n\n\n\n
import pandas as pd\nimport seaborn<\/code><\/pre>\n\n\n\n
example_block_height = 465100\ndf = pd.DataFrame(chain[example_block_height].txes.fee_per_byte(), columns=['Satoshi per byte'])<\/code><\/pre>\n\n\n\n
df<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
ax = df.reset_index().plot.scatter(x=\"index\", y=\"Satoshi per byte\")\nax.set_ylim(0)\nax.set_xlim(0)<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n