diff --git a/config.toml b/config.toml index 119375a..94623b7 100644 --- a/config.toml +++ b/config.toml @@ -25,14 +25,24 @@ pygmentscodefencesguesssyntax = true rtl= false + colorscheme = "light" + + # Series see also post count + maxSeeAlsoItems = 5 + + # Enable Twemoji + enableTwemoji = true + + # Custom CSS custom_css = [] + # Custom JS + custom_js = [] - # Social links [[params.social]] name = "Git" - icon = "fab fa-git" + icon = "fab fa-gitlab" weight = 1 url = "https://git.ericxliu.me/eric" [[params.social]] @@ -50,25 +60,25 @@ pygmentscodefencesguesssyntax = true [languages.en] languagename = "English" [[languages.en.menu.main]] - name = "Gitlab" + name = "Posts" weight = 1 + url = "/posts/" + [[languages.en.menu.main]] + name = "Gitlab" + weight = 2 url = "https://git.ericxliu.me" [[languages.en.menu.main]] name = "Notebook" - weight = 2 + weight = 3 url = "https://hub.ericxliu.me" [[languages.en.menu.main]] name = "Go" - weight = 3 - url = "https://go.ericxliu.me/server" - [[languages.en.menu.main]] - name = "Sign in" weight = 4 - url = "https://auth.ericxliu.me" + url = "https://go.ericxliu.me/server" [[languages.en.menu.main]] name = "|" weight = 10 [[languages.en.menu.main]] - name = "Homer" + name = "Sign in" weight = 11 - url = "https://ericxliu.local" + url = "https://auth.ericxliu.me" diff --git a/content/README.md b/content/README.md deleted file mode 100644 index 0b30156..0000000 --- a/content/README.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Eric's Homepage" -date: 2018-06-01T06:44:30Z -draft: true ---- -Hello World! - diff --git a/content/about.md b/content/about.md index 23502d1..312f7bd 100644 --- a/content/about.md +++ b/content/about.md @@ -1,6 +1,5 @@ --- title: "About" date: 2018-06-01T07:13:52Z -draft: true --- diff --git a/content/posts/credit_card.html b/content/posts/credit_card.html new file mode 100644 index 0000000..01fe59d --- /dev/null +++ b/content/posts/credit_card.html @@ -0,0 +1,13716 @@ ++++ +title = "Credit Card Spending Dashboards" +date = "2020-06-16" ++++ + + + + +gspread_test + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
In [18]:
+
+
+
import pandas as pd
+import gspread
+import matplotlib.pyplot as plt
+
+ +
+
+
+ +
+
+
+
In [2]:
+
+
+
gc = gspread.service_account()
+
+sh = gc.open_by_key("1_tbwz6Z9uVZMJQZTysSQJYbSg-LCRdk6u49UngChM-Y")
+worksheet = sh.worksheet("Responses Raw")
+
+dataframe = pd.DataFrame(worksheet.get_all_records())
+
+ +
+
+
+ +
+
+
+
In [3]:
+
+
+
dataframe["Incurring Month"] = pd.to_datetime(dataframe["Incurring Date"]).dt.strftime(
+    "%Y%m"
+)
+df_filtered = dataframe[~dataframe["Category"].isin(["Fake", "Travel"])]
+
+ +
+
+
+ +
+
+
+
+

Monthly Details

+
+
+
+
+
+
In [28]:
+
+
+
df_by_monthly = pd.pivot_table(
+    df_filtered,
+    index="Incurring Month",
+    columns="Category",
+    values="Amount of Money",
+    aggfunc=sum,
+)
+df_by_monthly.fillna(0)
+
+ +
+
+
+ +
+
+ + +
+ +
Out[28]:
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryActivitiesBillsDepositDiningDisputeEntertainmentGasGroceriesLifetime activitiesShopping
Incurring Month
2019040.0222.680.000.000.00113.500.000.000.00.00
201905234.0338.580.00307.660.00178.84161.62281.920.0132.23
2019060.0143.240.00345.080.00134.17150.79343.410.0680.92
2019070.0923.230.00282.230.00161.12201.25508.380.0346.32
201908312.0416.790.00267.680.0054.55121.98364.140.0239.29
2019090.0410.510.00281.120.00221.05129.97425.750.0170.33
2019100.0550.250.00458.670.00259.90122.33259.790.00.00
2019110.0410.730.00413.830.0038.78166.49331.740.0779.81
2019120.0393.310.00318.410.0054.7588.22238.690.0901.00
2020010.0375.330.00577.320.0037.0087.90266.090.0898.55
2020020.0380.710.00314.660.000.0081.64415.990.0375.22
2020030.0421.820.00398.820.0029.9928.87833.660.053.34
2020040.0438.680.00293.780.00143.890.00828.300.055.04
2020050.0325.94550.94352.4852.470.0068.74466.270.0117.67
2020060.0179.000.00110.920.000.000.00146.489.0124.88
+
+
+ +
+ +
+
+ +
+
+
+
In [26]:
+
+
+
df_by_monthly_plot = df_by_monthly.plot.bar(stacked=True, figsize=(16, 9))
+df_by_monthly_plot.set_ylabel("Total Amount ($)")
+plt.xticks(rotation=45);
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+
+
+

Travel Details

+
+
+
+
+
+
In [30]:
+
+
+
df_travel = dataframe[
+    (dataframe["Category"] == "Travel") & (dataframe["Travel Tag"] != "")
+]
+
+ +
+
+
+ +
+
+
+
In [31]:
+
+
+
df_travel_by_tag = pd.pivot_table(
+    df_travel,
+    index="Travel Tag",
+    columns="Travel Details",
+    values="Amount of Money",
+    aggfunc=sum,
+    margins=True,
+)
+df_travel_by_tag = (
+    df_travel_by_tag.sort_values(["All"], ascending=False)
+    .drop("All", axis=1)
+    .drop("All")
+)
+df_travel_by_tag.fillna(0)
+
+ +
+
+
+ +
+
+ + +
+ +
Out[31]:
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Travel DetailsAccomendationAirlineDiningGasGroceryMiscPublic TransportationRental CarShoppingTour Ticket
Travel Tag
Hawaii Trip2192.481941.98585.9081.81164.9526.0108.49324.45235.51536.54
Yellow Stone NP Trip1678.58664.00370.1151.8180.110.0114.30366.52263.64167.88
Golden Pines RV Resort135.360.000.00185.83139.606.00.00302.808.0410.00
Redwood State Park RV Camping77.990.000.00131.94141.210.00.00230.7517.610.00
Pinnacles NP Trip60.000.000.000.000.000.00.000.0010.750.00
+
+
+ +
+ +
+
+ +
+
+
+
In [32]:
+
+
+
df_travel_by_tag_plot = df_travel_by_tag.plot.bar(stacked=True, figsize=(12, 8))
+df_travel_by_tag_plot.set_ylabel("Total Amount ($)")
+plt.xticks(rotation=45);
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+
+
In [ ]:
+
+
+
 
+
+ +
+
+
+ +
+
+
+ + + + + + + + diff --git a/content/posts/hello-world.md b/content/posts/hello-world.md deleted file mode 100644 index a28e037..0000000 --- a/content/posts/hello-world.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "Hello World" -date: 2018-06-01T07:15:10Z -draft: true ---- -