[PYTHON] Routine management with calendar

Weekly routine management. I think Google Calendar, handwriting, and Excel are fine, but I think there will be some changes during trial and error, so I made it with python.

Since it is divided by day, you can check achievement / non-achievement by putting a check mark every day.

I manage muscle training menus, meals, and learning English.

The output csv is printed and used by "pasting only the value" into the Excel format.

I feel that simplicity is the best.

#!/usr/bin/env python
# coding: utf-8

# In[1]:


import pandas as pd
# import datetime as dt
# from datetime import datetime as dtdt
import calendar


# In[2]:


c = calendar.Calendar(firstweekday=0)


# In[3]:


cld = c.monthdayscalendar(2020, 8)


# In[4]:


routine = []
# routine.append(["","","","","","","",]) #List routines for each day of the week
routine.append(["a","b","c","d","e","f","",])

# routine.append(["" for _ in range(7)]) #List the same routine every day
# routine.append(["routine" for _ in range(7)]) #List the same routine every day

# In[5]:

week=["Month","fire","water","wood","Money","soil","Day"]


# In[6]:


df = pd.DataFrame(week).T
for i in range(len(cld)):
    df_cld = pd.DataFrame(cld[i]).T
    df_cld = pd.concat([df_cld,df_routine]).reset_index(drop = 1)
    [df_cld.drop(columns=i,inplace=True) for i in range(len(df_cld.T)) if df_cld.T[0][i] is 0] #Deleted last month / next month
    df = pd.concat([df,df_cld]).reset_index(drop = True)
df.to_csv('sc.csv')


Recommended Posts

Routine management with calendar
YouTube video management with Python 3
Password management with python: keyring
Server management with Jupyter (1) import
Notes on package management with conda
Python installation and package management with pip
Get holidays with the Google Calendar API
Using MLflow with Databricks ③ --Model lifecycle management -
Excel table creation with Python [Progress management table]