-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Post, new method, and rolling deprecation (#43)
* script * finalize image * Add wrapper for the series * address rolling deprecation * up the version * run ruff
- Loading branch information
Showing
5 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pandas as pd | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
import latent_calendar | ||
|
||
|
||
if __name__ == "__main__": | ||
# More information on the dataset: | ||
# https://posit-dev.github.io/great-tables/reference/data.pizzaplace.html#great_tables.data.pizzaplace | ||
file = "https://raw.githubusercontent.com/posit-dev/great-tables/main/great_tables/data/05-pizzaplace.csv" | ||
|
||
df = pd.read_csv(file) | ||
|
||
# Create a datetime column | ||
datetime_column = pd.to_datetime(df["date"].str.cat(df["time"], sep=" ")) | ||
|
||
|
||
fig, axes = plt.subplots(nrows=1, ncols=2, sharey=True) | ||
fig.suptitle("Plotting datetime column from posit-dev/great-tables pizza place dataset") | ||
|
||
ax = axes[0] | ||
datetime_column.sample(n=100, random_state=0).cal.plot(ax=ax) | ||
ax.set_title("Continuous Series cal.plot()") | ||
|
||
ax = axes[1] | ||
( | ||
datetime_column | ||
.cal.aggregate_events(minutes=30) | ||
.cal.plot_row(ax=ax) | ||
) | ||
ax.set_title("Discretized Series cal.plot_row()") | ||
|
||
plt.show() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters