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.5.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66161936be4ff9eaa9e0772c52102c388ed13111730a8472400042066618cd9c |
|
MD5 | b2355c003035072e1a24f3b6a99e5837 |
|
BLAKE2b-256 | cfb67c9019aea05be5f5c54bbef53f7555becebfef4e4f3ee2a4b7635da4320e |