Skip to content

Instantly share code, notes, and snippets.

@abdulrahman004
Last active September 1, 2020 08:35
Show Gist options
  • Save abdulrahman004/6a9d1f68b32df2009a4326baf0e3116a to your computer and use it in GitHub Desktop.
Save abdulrahman004/6a9d1f68b32df2009a4326baf0e3116a to your computer and use it in GitHub Desktop.
#python3
import pandas as pd
df = pd.read_excel("Oct.xlsx", skiprows=2)
df = df.fillna(method="ffill")
with open ("out.txt","w") as out:
for i, r in df.iterrows():
if i == 0:
continue
print(f"processing {i}")
out.write(f',{{"month":"Oct","day":{int(r[0])},"fajrBegin":"{r[3].strftime("%I:%M")}","fajr":"{r[4].strftime("%I:%M")}","shuruq":"{r[5].strftime("%I:%M")}","dhuhrBegin":"{r[6].strftime("%I:%M")}","dhuhr":"{r[7].strftime("%I:%M")}","asrBegin":"{r[8].strftime("%I:%M")}","asrBeginHanafi":"{r[9].strftime("%I:%M")}","asr":"{r[10].strftime("%I:%M")}","maghribBegin":"{r[11].strftime("%I:%M")}","maghrib":"{r[12].strftime("%I:%M")}","ishaBegin":"{r[13].strftime("%I:%M")}","isha":"{r[14].strftime("%I:%M")}"}}')
out.write("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment