GPS
- soccon.gps.date_series_to_str(date)
Formats series containing day, month, and year to “/” separated string. Intended to be used with outputs from find_n_cont_days
- Parameters:
date (Series) – Series containing month, day, year.
- Returns:
str – Data in date formatted as month/day/year
- soccon.gps.day_to_obs_day(df, day)
Returns the observation day of a given Series that has values of “year”, “month”, and “day”
- Parameters:
df (DataFrame) – csv output of gps_stats_main read in by Pandas
day (Series) – “year”, “month”, and “day” values to find
- Raises:
Exception – day not found in df
- Returns:
int – Observation day (0-indexed)
- soccon.gps.find_max_cont_days(df)
- soccon.gps.find_n_cont_days(df, n)
Determines if n consecutive days exist in df.
- Parameters:
df (DataFrame) – Output CSV of process_gps loaded in as a pandas DataFrame.
n (int, optional) – Number of days to check for consecutivity. Defaults to 30.
- Returns:
bool – True if n consecutive days were found, False otherwise
Series – Start day (day, month, year). If no consecutive set of days found, last tested start day.
Series – End day (day, month, year). If no consecutive set of days found, last tested end day.
- soccon.gps.is_consecutive(days, months, years)
Determines if passed data constitute a continuous set of days.
- Parameters:
days (Series) – Day values
months (Series) – Month values
years (Series) – Year values
- Returns:
bool – True if data is consecutive, otherwise False
int – Last “valid” index. If whole range is continuous, this is equal to length of values, if discontinuity found, this is equal to the ind on which the loop broke