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 | |
import numpy as np | |
mydata = pd.DataFrame({ | |
"Temp":[10,20,30,40,50], | |
"Data":[123,323,335,567,886] | |
}) | |
point_to_interpolate = 33 |
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.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
# If modifying these scopes, delete the file token.pickle. | |
SCOPES = ['https://www.googleapis.com/auth/photoslibrary.readonly'] | |
creds = None |
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
items = [] | |
nextpagetoken = None | |
# The default number of media items to return at a time is 25. The maximum pageSize is 100. | |
while nextpagetoken != '': | |
print(f"Number of items processed:{len(items)}", end='\r') | |
results = google_photos.mediaItems().list(pageSize=100, pageToken=nextpagetoken).execute() | |
items += results.get('mediaItems', []) | |
nextpagetoken = results.get('nextPageToken', '') |
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 | |
# Convert the list of dict into a dataframe. | |
df = pd.DataFrame(items) | |
# Taking the column mediaMetadata and splitting it into individual columns | |
dfmeta = df.mediaMetadata.apply(pd.Series) | |
# Combining all the different columns into one final dataframe | |
photos = pd.concat( | |
[ |
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
# Convert the creation time to a datetime dtype | |
photos.creationTime = pd.to_datetime(photos.creationTime) | |
# Convert other numeric data into numeric dtypes | |
for c in ['width', 'height', 'apertureFNumber', 'focalLength', 'isoEquivalent']: | |
photos[c] = pd.to_numeric(photos[c]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 PIL import Image, ImageDraw | |
img = Image.new("RGB", (500, 500)) | |
ic = ImageDraw.Draw(img) | |
ic.ellipse([0, 0, 500, 500], fill="RED") | |
img.save("basic.png") |
OlderNewer