Skip to content

Instantly share code, notes, and snippets.

@nim4n136
Created January 22, 2020 06:54
Show Gist options
  • Save nim4n136/872b5c872cec64a1eda58c3bacc7d07d to your computer and use it in GitHub Desktop.
Save nim4n136/872b5c872cec64a1eda58c3bacc7d07d to your computer and use it in GitHub Desktop.
Final chunked pandas
import urllib.request
from urllib.request import urlopen
import pandas as pd
from datetime import date
start = str('2019-01-01')
end = str('2020-01-22')
dates = pd.date_range(start, end, freq="D")
# 30 item per cluster
n = 30
final = [dates[i * n:(i + 1) * n] for i in range((len(dates) + n - 1) // n )]
print(final)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment