Skip to main content

This Library accept pandas dataframe, date_column and optional end date If end date is not provide, current today will be use internally by the library

Project description

This package "week by Week"

is attempt to have Python library that

  1. Generate week range from pandas dataframe from the first data point date to the current or a given date
  2. Group pandas row into weekly base on the date/timestamp column

Release Log

  1. week-by-week version 3.14.0a0 (Released, June 21, 2022) Weekfly Dataframe capability added
  2. week-by-week version 3.14.0 (Released, June 20, 2022)

Usage after installation

from week_by_week import WeekRange

Instantiate the class get_weeks = WeekRange(df, 'timestamp','2022/06/01', WK_start='sun')

Required parameter are: 1. df -- pandas dataframe 2. timestamp -- date columnin your df 3. WK_start change between 'Mon' to 'Sun' Optional parameter: 1. end_date

call getAllweeks()`` method to retrieve all weeks weeks = get_weeks.getAllweeks()```

And to retrieve data splitted into week range, invoke getWeekData()

print(get_weeks.getWeekData())

To retrieved Pandas Dataframe splited into week invoke the following interface method

for week in get_weeks.retunpandasDF():
    print(week)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

week_by_week-3.14.0b0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

week_by_week-3.14.0b0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page