Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Jul 23, 2024
1 parent 4659783 commit ccdff15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions newshomepages/analyze/drudge.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,13 @@ def get_top_verb(lemma: str) -> str:

# Get the timeseries for top words
min_date, max_date = story_df.earliest_date.min(), story_df.earliest_date.max()
print(f"Min date: {min_date}")
print(f"Max date: {max_date}")

def get_timeseries(lemma: str) -> str:
"""Pull the day to day timeseries for the provided word."""
# Count the top words by day
print(f"- {lemma}")
df = (
qualified_df[qualified_df.lemma == lemma]
.merge(
Expand Down Expand Up @@ -284,10 +287,11 @@ def drudge_hyperlinks(output_dir: str = "./"):
"url",
],
dtype=str,
parse_dates=["date"],
low_memory=True,
)

# Parse dates
df["date"] = pd.to_datetime(df["date"])

# Trim the strings
print("Trimming strings")
df["text"] = (
Expand Down

0 comments on commit ccdff15

Please sign in to comment.