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.8.1.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24e6d62980163dfc4599f646fad33a54d1b2bd8aeeee0a4ed6bd7ed9e307ebaa |
|
MD5 | ba045d7b202267c9f34fa0a2da12d43b |
|
BLAKE2b-256 | 6e00643969c022925bb100415f609aae1ae9b7f3e4fe34586fe660418f738d0c |
Close
Hashes for ProcessEntropy-0.8.1.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc99038e7f533f887b6e511fb63fcae4885f4e7fcf9b0709421237c09bff2737 |
|
MD5 | fe0dd4332f90b8b483e51ca852021806 |
|
BLAKE2b-256 | 11b27e042d20ed8f8802ba416c27361b08cea4f8dcc7c3fe9a6acdb58017c4e8 |