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 |
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 | |
# Read File | |
customer_sample_file = pd.read_excel("CustomerSample.xlsx", sheet_name="Prospects", parse_dates=[0]) | |
# Get records from 2017 or earlier | |
customers_2017_or_earlier = customer_sample_file[customer_sample_file["DateTime Recorded"] < "2018-01-01"] | |
# Output the records | |
customers_2017_or_earlier.to_excel("Customers2017OrEarlier.xlsx") |
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 | |
# Read all three files into pandas dataframes | |
marketing_analyst_names = pd.read_excel("MarketingAnalystNames.xlsx") | |
sales_rep_names = pd.read_excel("SalesRepNames.xlsx") | |
senior_leadership_names = pd.read_excel("SeniorLeadershipNames.xlsx") | |
# Create a list of the files in order you want them appended | |
all_df_list = [marketing_analyst_names, sales_rep_names, senior_leadership_names] |
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 | |
# Read both Excel files | |
customers = pd.read_excel("Customers.xlsx") | |
calls = pd.read_excel("Calls.xlsx") | |
# Inner Join | |
inner_join_df = customers.merge(calls, how="inner", on="Name") | |
inner_join_df.to_excel("InnerJoin.xlsx") |
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 smtplib | |
''' | |
Change these to your credentials and name | |
''' | |
your_name = "Bill Butlicker" | |
your_email = "[email protected]" | |
your_password = "bearsbeetsbattlestar" |
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 | |
# Read the file | |
apple_stock = pd.read_excel("AppleStock.xlsx") | |
# Fill in Ticker Missing Values with AAPL | |
apple_stock["Ticker"] = apple_stock["Ticker"].fillna("AAPL") | |
# Back Fill Open Column | |
apple_stock["Open"] = apple_stock["Open"].fillna(method="bfill") |
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 | |
# Read the file and specify which column is the date | |
customer_calls = pd.read_excel("CustomerCalls.xlsx") | |
# Output with dates converted to YYYY-MM-DD | |
customer_calls["DateTime Recorded"] = pd.to_datetime(customer_calls["DateTime Recorded"]).dt.strftime("%Y-%m-%d") | |
customer_calls.to_excel("CustomerCalls_YYYY_MM_DD.xlsx") |
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 | |
from opencage.geocoder import OpenCageGeocode | |
key = "REPLACE_WITH_YOUR_API_KEY" | |
geocoder = OpenCageGeocode(key) | |
addresses_df = pd.read_excel("Addresses.xlsx") | |
addresses = addresses_df["Addresses"].values.tolist() |
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 | |
file_df = pd.read_excel("Duplicates.xlsx") | |
# Keep only FIRST record from set of duplicates | |
file_df_first_record = file_df.drop_duplicates(subset=["Name", "Address", "Call Date"], keep="first") | |
file_df_first_record.to_excel("Duplicates_First_Record.xlsx", index=False) | |
# Keep only LAST record from set of duplicates | |
file_df_last_record = file_df.drop_duplicates(subset=["Name", "Address", "Call Date"], keep="last") |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Save Web Form Data to Spreadsheets - Contact Form</title> | |
<script | |
src="https://code.jquery.com/jquery-3.4.1.js" | |
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" | |
crossorigin="anonymous"></script> | |
<script> | |
function SubForm (){ |
OlderNewer