This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df1 = pd.DataFrame({ 'colA': [10, 20, 30], | |
'colB': [100, 200, 300]}) | |
df2 = pd.DataFrame({ 'colA': [40, 20, 50], | |
'colB': [400, 200, 500]}) | |
pd.concat([df1, df2]).drop_duplicates().reset_index(drop=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Google import Create_Service | |
import pandas as pd | |
CLIENT_SECRET_FILE = 'client_secret.json' | |
API_SERVICE_NAME = 'sheets' | |
API_VERSION = 'v4' | |
SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'] | |
gsheetId = '<Google Sheet Id>' | |
s = Create_Service(CLIENT_SECRET_FILE, API_SERVICE_NAME, API_VERSION, SCOPES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Testing() | |
MsgBox "Is file open?: " & IsFileOpen("<File Path>") | |
End Sub | |
Public Function IsFileOpen(ByVal File_Path As String) As Boolean | |
Dim fileNum As Long, errNumber As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub SplitTime() | |
Dim dbCurrent As Database | |
Dim rst As Recordset | |
Dim MaxTime As Date | |
Set dbCurrent = CurrentDb | |
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT ID FROM Table1") | |
CurrentDb.Execute "DELETE FROM Output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Google import Create_Service | |
import pandas as pd | |
import numpy as np | |
CLIENT_SECRET_FILE = 'client_secret.json' | |
API_SERVICE_NAME = 'sheets' | |
API_VERSION = 'v4' | |
SCOPES = ['https://www.googleapis.com/auth/spreadsheets'] | |
gsheetId = '1aRMp_3-M5OP-m3GRHH7vYOWnBHe9MW-A3Gb6HWB5sbU' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from google.cloud import translate | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"<CLIENT_SECRET.json>" | |
translate_client = translate.Client() | |
inputStrings = 'Sample Text'' | |
result = translate_client.detect_language(inputStrings) | |
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from google.cloud import translate | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"<CLIENT_SECRET.json>" | |
translate_client = translate.Client() | |
result = translate_client.get_languages() | |
languageList = pd.DataFrame(result) | |
print(languageList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from google.cloud import translate | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'<CLIENT_SECRET.json>' | |
translate_client = translate.Client() | |
text = 'Good Morning. GoodBye. And Hello' | |
target = 'ja' | |
output = translate_client.translate( | |
text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import os | |
from pprint import pprint as pp | |
from google_auth_oauthlib.flow import Flow, InstalledAppFlow | |
from googleapiclient.discovery import build | |
from google.auth.transport.requests import Request | |
import pandas as pd | |
CLIENT_SECRET_FILE = 'client_secret.json' | |
API_SERVICE_NAME = 'sheets' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) | |
Call Send_Email | |
End Sub | |
Private Sub Send_Email() | |
Dim olNS As Namespace | |
Dim olMail As MailItem |