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 plotly.graph_objects as go | |
import pandas as pd | |
def serp_heatmap(df, num_domains=10, select_domain=None): | |
df = df.rename(columns={'domain': 'displayLink', | |
'searchTerms': 'keyword'}) | |
top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
top_domains = df['displayLink'].value_counts()[:num_domains].index.tolist() | |
top_df = df[df['displayLink'].isin(top_domains) & df['displayLink'].ne('')] |
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 | |
import ffmpeg | |
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='1'): | |
""" | |
Compress video file to max-supported size. | |
:param video_full_path: the video you want to compress. | |
:param size_upper_bound: Max video size in KB. | |
:param two_pass: Set to True to enable two-pass calculation. | |
:param filename_suffix: Add a suffix for new video. |