diff --git a/index.html b/index.html index 6f7032c..d8d381f 100644 --- a/index.html +++ b/index.html @@ -179,7 +179,7 @@ Eric Liu - [4b89cb4] + [291f598] diff --git a/index.xml b/index.xml index 863e984..c053f43 100644 --- a/index.xml +++ b/index.xml @@ -16,15 +16,6 @@ rootCA.pem vpnclient.ovpn - - Credit Card Spending Dashboards - https://ericxliu.me/posts/credit_card/ - Tue, 16 Jun 2020 00:00:00 +0000 - - https://ericxliu.me/posts/credit_card/ - gspread_test (function() { function addWidgetsRenderer() { var mimeElement = document.querySelector('script[type="application/vnd.jupyter.widget-view+json"]'); var scriptElement = document.createElement('script'); var widgetRendererSrc = '@jupyter-widgets/html-manager@*/dist/embed-amd.js'; var widgetState; // Fallback for older version: try { widgetState = mimeElement && JSON.parse(mimeElement.innerHTML); if (widgetState && (widgetState.version_major /*! * * Twitter Bootstrap * */ /*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github. - - About https://ericxliu.me/about/ diff --git a/posts/credit_card/index.html b/posts/credit_card/index.html deleted file mode 100644 index 3a7c153..0000000 --- a/posts/credit_card/index.html +++ /dev/null @@ -1,13929 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Credit Card Spending Dashboards · Eric's Personal Page - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - -
- - - -
- -
-
-
-
-

- - Credit Card Spending Dashboards - -

-
- -
- -
- - - - - -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 [ ]:
-
-
-
 
-
- -
-
-
- -
-
-
- - - - - - - - - -
- - -
- - - - - - -
-
- - -
- -
- - -
-
- - - © - - 2016 - - - 2023 - Eric Liu - - - [commit] -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - diff --git a/posts/index.html b/posts/index.html index 299aec6..18dc16d 100644 --- a/posts/index.html +++ b/posts/index.html @@ -132,10 +132,6 @@ October 26, 2020 Some useful files -
  • - June 16, 2020 - Credit Card Spending Dashboards -
  • diff --git a/posts/index.xml b/posts/index.xml index 5240283..2dea004 100644 --- a/posts/index.xml +++ b/posts/index.xml @@ -16,14 +16,5 @@ rootCA.pem vpnclient.ovpn
    - - Credit Card Spending Dashboards - https://ericxliu.me/posts/credit_card/ - Tue, 16 Jun 2020 00:00:00 +0000 - - https://ericxliu.me/posts/credit_card/ - gspread_test (function() { function addWidgetsRenderer() { var mimeElement = document.querySelector('script[type="application/vnd.jupyter.widget-view+json"]'); var scriptElement = document.createElement('script'); var widgetRendererSrc = '@jupyter-widgets/html-manager@*/dist/embed-amd.js'; var widgetState; // Fallback for older version: try { widgetState = mimeElement && JSON.parse(mimeElement.innerHTML); if (widgetState && (widgetState.version_major /*! * * Twitter Bootstrap * */ /*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ /*! normalize.css v3.0.3 | MIT License | github. - - diff --git a/sitemap.xml b/sitemap.xml index 4c30123..30789b9 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -10,9 +10,6 @@ https://ericxliu.me/posts/useful/ 2020-10-26T04:47:36+00:00 - - https://ericxliu.me/posts/credit_card/ - 2020-06-16T23:30:17-07:00 https://ericxliu.me/about/ 2020-06-16T23:30:17-07:00