Skip to content

Instantly share code, notes, and snippets.

View kallewesterling's full-sized avatar
🏠
Working from home

Kalle Westerling kallewesterling

🏠
Working from home
View GitHub Profile
This file has been truncated, but you can view the full file.
[{"Date":"1928","Category":"","Performer":"Gloria Swanson","Normalized performer":"Sepia Gloria Swanson","Performer first-name":"Sepia Gloria Swanson","Performer last-name":"—","Venue":"Book Store","Normalized Venue":"Book Store","City":"Chicago, IL","Normalized City":"Chicago, IL","Unique venue":"Book Store (Chicago, IL)","Revue name":"","Normalized Revue Name":"","Legal name":"— Winston","Alleged age":0,"Assumed birth year":0,"Source clean":"On 'Gloria Swanson' (Real Name: Mr. Winston), January 1, 1928, 221","Newspaper_ID":"","Date_unknown":"","Page_unknown":"","Newspaper":"—","EIMA_ID":0,"Edge Comment":"","Exclude from visualization":"","Comment on node: performer":"Legal name here is \"Mr. Winston,\" full legal name corroborated by Afro-American, December 24, 1932, 18.","Comment on node: venue":"\"rendezvous protected by the fact that his 'protector' was a big shot—a well-known underworld figure. All went well until his 'boy friend' had a fit of jealousy—a tantrum of violence during which he practically w
@kallewesterling
kallewesterling / periodize_dates.py
Last active April 13, 2021 17:02
Make a list of list where dates are chained together based on their delta
def periodize_dates(dates:list=[], delta:datetime.timedelta=timedelta(days=14), dateformat='%Y-%m-%d'):
"""
Takes a list of dates and returns a list of lists, where the original list has been divided into strings of dates that are within the provided delta.
Parameters:
dates (list): List of dates that you want periodized.
delta (datetime.timedelta/int): The delta that you want compared. If provided as type `int`, the value will be interpreted as `timedelta.days=<int>`.
dateformat (str): A date formatting string that all dates in the list will need to adhere to.
Returns:
list:Periodized dates