Python Tutorial
Python is a verstile programming language that has gained a lot of attention and popularity. Using Python, you do things like develop web applications, desktop applications, task automation, artificial intelligence (AI), big data, data analytics, machine learning (ML), and many other things.
Python is really becoming as the leader in data science and data analytics. With so many open source libraries to choose from (Pandas, scikit-learn, NumPy, Matplotlib), learning data analysis in Python just got so much easier.
Source Code: How To Add And Delete Columns To A Table In Google BigQuery using BigQuery API with Python
Buy Me a Coffee? Your support is much appreciated! Source Code: import time from google.cloud import bigquery # construct bigquery client client = bigquery.Client() # construct table entity reference dataset_ref = bigquery.DatasetReference(client.project, 'Staging')...
Source Code: Display Info When You Hover To A Data Point In Matplotlib
Buy Me a Coffee? Your support is much appreciated! demo.py import matplotlib.pyplot as plt import numpy as np # Step 1. Create a scatter chart x = np.random.rand(20) y = np.random.rand(20) colors = np.random.randint(1, 5, size=len(x)) norm = plt.Normalize(1, 4)...
Source Code: Copy Excel Tables To QTableWidget In PyQt6
Buy Me a Coffee? Your support is much appreciated! demo.py import sys from PyQt6.QtWidgets import (QApplication, QWidget, QTableWidget, QTableWidgetItem, QHBoxLayout, QVBoxLayout) from PyQt6.QtCore import Qt class TableWidget(QTableWidget): def __init__(self,...
Source Code: Import Multiple CSV Files (Data Files) to SQL Server With Python
Buy Me a Coffee? Your support is much appreciated! Source Code import os import pypyodbc as odbc # pip install pypyodbc def bulk_insert(date_file, target_table): sql = f""" BULK INSERT {target_table} FROM '{date_file}' WITH ( FORMAT='CSV', FIRSTROW = 2,...
Source Code: Manage Your YouTube Playlist With Python
Buy Me a Coffee? Your support is much appreciated! youtube.py from google_apis import create_service class YouTube: API_NAME = 'youtube' API_VERSION = 'v3' SCOPES = ['https://www.googleapis.com/auth/youtube', 'https://www.googleapis.com/auth/youtube.force-ssl'] def...
Source Code: Manage Google BigQuery Datasets With BigQuery API In Python
Buy Me a Coffee? Your support is much appreciated! Source Code: from google.cloud import bigquery, bigquery_datatransfer class DatasetManager: def __init__(self, client): self.client = client def delete_dataset(self, dataset_id): # update `not_found_ok` parameter to...
Source Code: Create And Delete Outlook Calendar Events Using Microsoft Graph API In Python
Buy Me a Coffee? Your support is much appreciated! Source Code: import requests from rich import console from ms_graph import generate_access_token, GRAPH_API_ENDPOINT console = console.Console() APP_ID = '<APP ID>' SCOPES = ['Calendars.ReadWrite'] # Step 1....
Source Code: Google BigQuery Tutorial: Add, Update, Delete Labels With BigQuery API Using Python
Buy Me a Coffee? Your support is much appreciated! Source Code: import os from google.cloud import bigquery os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'bigquery_service_acct.json' client = bigquery.Client('sql-for-bigquery') # ------------------------------- #...
Source Code: Upload Local CSV File To Google BigQuery With BigQuery API Using Python
Buy Me a Coffee? Your support is much appreciated! Source Code: import time from google.cloud import bigquery client = bigquery.Client() job_config = bigquery.LoadJobConfig( source_format=bigquery.SourceFormat.CSV, skip_leading_rows=1, autodetect=True, ) table_id =...
Source Code: Automate CSV File Bulk Upload With Google BigQuery API Using Python
Buy Me a Coffee? Your support is much appreciated! Source Code: from pathlib import Path import time import os from google.cloud import bigquery def table_reference(project_id, dataset_id, table_id): dataset_ref = bigquery.DatasetReference(project_id, dataset_id)...
