Analizando la rentabilidad de los tags más populares en Hive con Python [ESP/ENG]


WhatsApp Image 2023-02-11 at 4.27.57 PM.jpeg

Este código utiliza la librería beem y pandas para analizar la ganancia en HBD (una moneda digital en la plataforma Hive) asociada con los 10 tags más populares en la plataforma Hive.

El código define una función llamada comments_payouts que toma una fila de un DataFrame como entrada y devuelve el resultado de dividir el valor total de los pagos (total_payouts) por el número de publicaciones de mayor pago (top_posts).

A continuación, se crea un objeto q que utiliza la clase Query de beem para acceder a los tags más populares en la plataforma Hive. Se utiliza la función Trending_tags para agregar los tags a una lista y crear un DataFrame (df) con estos datos.

Se reemplaza el texto " HBD" en la columna "total_payouts" con valores numéricos para que sea posible realizar cálculos con ellos. Luego, se filtra el DataFrame para mostrar solo aquellos tags que tienen más de 500 comentarios, y se ordena de mayor a menor por número de comentarios.

Por último, se agrega una nueva columna llamada "ganancia" al DataFrame utilizando la función comments_payouts y el método apply de pandas, y se imprime el resultado final.

Este código puede ser útil para aquellos que deseen conocer las ganancias asociadas con los tags más populares en la plataforma Hive y comparar la relación entre el número de comentarios y los pagos en HBD.

ENGLISH

This code uses the beem and pandas library to analyze the HBD (a digital currency on the Hive platform) payout associated with the 10 most popular tags on the Hive platform.

The code defines a function called comments_payouts that takes a row of a DataFrame as input and returns the result of dividing the total value of payouts (total_payouts) by the number of top paying posts (top_posts).

Next, a q object is created that uses beem's Query class to access the most popular tags in the Hive platform. The Trending_tags function is used to add the tags to a list and create a DataFrame (df) with this data.

The text "HBD" in the column "total_payouts" is replaced with numeric values so that calculations can be performed with them. Then, the DataFrame is filtered to show only those tags that have more than 500 comments, and sorted from highest to lowest by number of comments.

Finally, a new column called "gain" is added to the DataFrame using the comments_payouts function and the apply method of pandas, and the final result is printed.

This code may be useful for those who want to know the earnings associated with the most popular tags in the Hive platform and compare the relationship between the number of comments and payouts in HBD.

GITHUB
MUSICA


▶️ 3Speak

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center