Happy Heart's Day, Everyone!
While many are busy seeking out dates and planning sweet surprises for their loved ones, I’ve chosen to dedicate my day to something a bit different. I’m focusing on learning skills that I hope will be beneficial to our community.
Learning something new is always exciting. That's why I am sharing with you that I have learned something new. This may not be so new to most of us here, but I am just excited and happy to have done something that's working.
Image Source
POST, which sparked my interest in learning Python.I want to express my gratitude to @beaker007 for his insightful
I believe that developing this skill will be invaluable in safeguarding our community. By leveraging data analysis, we can effectively expose abuses and, more importantly, develop innovative strategies to foster improvements within our community. I may be far from there, but with baby steps, I believe I will eventually get there.
Python Exercise
In his POST, @beaker007 discussed in details on how to retrieve Hive Blockchain data and present these through interactive charts using Python.
In this post, I will share what I have learned and the steps I have taken.
Key steps
Set up a HiveSQL account
To set up a HiveSQL account, send 1 HBD to @hivesql (no memo needed). In this exercise, I used Hive @Keychain for my setup.
Once received, your account will be activated, and you'll get a small transfer back. The memo will contain your encrypted login details. You can view it on on Keychain under History.
Note: It is important that we keep supporting the HiveSQL proposal to keep it running for free!
Install the ODBC driver
This is needed for connecting to HiveSQL from Windows (I used version 18)
Download here
Image Source
Install Python packages: pypyodbc, pandas, and plotly.
Image Source
I guess I installed it earlier , this is how it looked like when I ran it...
Establishing the SQL Connection Using Python
This was the part where I kept getting stuck. I copied the code and pasted it, but when I ran it, I kept receiving errors.
As a newbie with zero knowledge in coding and programming, I almost gave up. I was hesitant to use AI, but after reading this article by @Azircon, I hope that my use of AI in this case is ethical.
Perplexity AI
I searched for the "best" AI for coding and programming, and all my results pointed to Perplexity AI. So I gave it a try.
The prompt I used was "Evaluate and Suggest Solutions" and this was the response.
I found it amusing that after spending so much time searching and inquiring, the answer was right in front of me all along. I already had it when I installed Python. It's the Python IDLE, a simple built-in tool for writing, editing, and running Python scripts.
So I copied the code to Python IDLE and run it and almost instantly I am already connected to the Hive SQL.
Adventures in the Splinterlands Data
Once the connection was established, I assumed I could continue my HiveSQL adventures. So, I tried using the data that interests me the most: Splinterlands data.
First Attempt
I was trying to figure out which countries most Splinterlands players are from, and I just wanted to see the top 10. I was disappointed with the result, but I can't just stop. I’ve already come this far.
Realizations
Upon further queries, I discovered that there is no available data on the blockchain regarding players' countries of origin—or perhaps I didn't dig deep enough or was looking in the wrong place.
Thank you for your time reading my post. I have to stop writing now and have to prepare dinner for the lovely couple in the house. Rest assured that I will continue to learn and share what I have learned with the community. Thank you for the inspiration!
Happy Valentines Day!
Thanks for the informative post.
Thanks for dropping by. I have to stop to prepare dinner. I was almost there will work on it again tomorrow. Thanks again !BBH
Nice😍. Love to see your first steps... learning is improving 💪
Thanks a lot ❤️ !BBH
Will work on it next week. Hopefully the codes will work by then. !BBH
Sure it will.. with the help of some AI it definitely will.. If not do not hesitate to ask 👍