A toolkit for calculating process entropy quickly. With specific applications to tweets.
Project description
ProcessEntropy
A toolkit for calculating process entropy quickly. With specific applications to tweets.
Example Usage
# Load in tweets between 2018/11/16 to 2019/01/01
import pandas as pd
with open("example_data/BBCWorld_Tweets_small.csv", 'r') as f:
BBC = pd.read_csv(f)
with open("example_data/BuzzFeedNews_Tweets_small.csv", 'r') as f:
BuzzFeed = pd.read_csv(f)
# Find process entropy of BuzzFeed tweets
from ProcessEntropy.CrossEntropy import tweet_self_entropy
print(tweet_self_entropy(BuzzFeed['tweet']))
# Find cross entropy between BuzzFeed and BBC World
from ProcessEntropy.CrossEntropy import timeseries_cross_entropy
target = list(zip(BuzzFeed['created_at'], BuzzFeed['tweet']))
source = list(zip(BBC['created_at'], BBC['tweet']))
print(timeseries_cross_entropy(target, source))
Requirements
- Python 3.x with packages:
- Numba
- NTLK
- Numpy
Installation
pip install ProcessEntropy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ProcessEntropy-0.7.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c2a7d09fd960e2dfe77369f78f2a0e972099c1b0059bf8a8dc299b4b2ade8a4 |
|
MD5 | 72fb11e361b56bdb904b9764fd6a2b21 |
|
BLAKE2b-256 | 2649a227b7481a4dc6486b0c2253f7e78d0ec95d0c14e3e0ddc8f0c315e7b233 |