The objective of project is to automate some data fetching process. My data consists of 4 different google sheets coming from different resources which after join build prefinal file and this prefinal file use in calculating business numbers. I have automated process of 4 different sheets utilising in prefinal sheet and everything worked fine on my jupyter notebook but while transferring my final Pandas Dataframe to google sheets using Pygsheets, some of the datatype of my columns in Dataframe are changing and yielding wrong data and calculations (from date type to numbers.
Please check dataframe
https://drive.google.com/open?id=1-w1USWl2NJLxYi1Nv52q3l1tlOFJZCmL
and resultant google sheet
https://drive.google.com/open?id=1KuG2vrBrwvvsEDCjkB9FH4-Y0Ihgqidc
I am using Google drive API and Pysheets for the task and example of my code is like
import pandas as pd
import datetime
import getRedshiftConfig
from redshift_connection import Connection
import pygsheets
import numpy as np
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import imaplib
import base64
import os
import email
prefinal_df=pd.read_csv("xyzzy.csv")
gc = pygsheets.authorize(service_file = "gsheetss.json") # Authorizing the Credentials
sh = gc.open('WHTAT_BaseData')
wk1=sh.sheet1
wk1.rows=df_neww.shape[0]
wk1.set_dataframe(df_neww,'A1')