I began my educational career as a computer science major...
please review some recent sample coding
please review some recent sample coding
/*_______________________
The weekly change of revenues from rentals of a specific science fiction title.
The three top titles will be used in the report.
________________________*/
WITH t1 AS
(SELECT
f.title AS film,
DATE_TRUNC('week', p.payment_date) AS Week_of,
SUM(p.amount) AS weekly_revenue
FROM film f
JOIN film_category fc
ON f.film_id = fc.film_id
JOIN category c
ON c.category_id = fc.category_id
JOIN inventory i
ON f.film_id = i.film_id
JOIN rental r
ON r.inventory_id = i.inventory_id
JOIN payment p
ON p.customer_id = r.customer_id
WHERE f.title = 'English Bulworth'
AND DATE_PART('month', payment_date) < 5
GROUP BY 1, 2
ORDER BY 1, 2)
SELECT film,
Week_of,
weekly_revenue,
LAG(weekly_revenue) OVER weekly_window AS Previous_Week_Revenue,
weekly_revenue - LAG(weekly_revenue) OVER weekly_window AS weekly_change
FROM t1
WINDOW weekly_window AS
(PARTITION BY film ORDER BY DATE_TRUNC('week', Week_of));
def country_gender_scores(country):
# create bins
bins = np.arange(200,800+20,20)
# plot histograms
scores = ['reading_score', 'math_score', 'science_score']
plt.subplots(3, figsize = [16,4])
plt.subplots_adjust(hspace = 0.6)
plt.suptitle('Scores by Sex of Student in ' + country, fontsize=18, y=0.95)
palette ={"Male": "C0", "Female": "C1"}
# iterath through scores
for n, score in enumerate(scores):
country_score = OECD_clean[OECD_clean['CNT'] == country]
plt.subplot(1,3,n+1)
sb.histplot(data = country_score, x = score, hue = 'ST04Q01', bins = bins, alpha = 0.3,
stat = "probability", palette = palette)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Joseph Occhipinti Resume </title>
<link rel="stylesheet" href="css/app.css">
<style>
.spacing {
padding: 8px;
}
.textColor {
color: 422B82;
background-color: 422B82;
}
.borderColor {
border-width: 1.5px;
border-style: solid;
border-color: black;
border-radius: 8px;
}
.backgroundColor {
background-color: #C5C9D0;
color: black;
}
.backgroundGradient {
background: linear-gradient(to bottom, white, #CCD8E9);
color: black;
}
h1 {
font_family: sans_serif, serif;
text-align: center;
font-size: 24pt;
}
h2 {
font_family: sans_serif, serif;
text-align: center;
font-size: 20pt;
font-style: italic;
}
h3 {
font_family: sans_serif, serif;
text-align: center;
font-size: 18pt;
font-style: normal;
}
h4 {
font_family: sans_serif, serif;
font-size: 16pt;
font-style: italic;
}
h5 {
font_family: sans_serif, serif;
font-size: 13pt;
}
p {
font-family: verdana;
font-size: 12px;
}
table, td {
border: .5px solid lightgrey;
border-collapse: collapse;
padding: 10px;
text-align: center;
}
table2, td {
padding: 10px;
text-align: left;
}
ul {
list-style-type: square;
}
</style>
</head>
<body>
<div class="textColor borderColor backgroundGradient">
<h1>Joseph Occhipinti</h1>
<h2>Educator / Geospatial Analyst / Researcher</h2>
<table style="width:100%">
<tr>
<td colspan= "2">joeocchipinti11@gmail.com</td>
<td>54 Seminole Ave. Hubbardston, MA 01452</td>
</tr>
<tr>
<td colspan= "2">814.319.5665</td>
<td colspan= "2"><a href="https://www.linkedin.com/in/joeocchipinti/">linkedin</a>
<td></td>
</tr>
</table>
</div>
<div class="spacing textColor borderColor backgroundColor">
<h3>Summary</h3>
<h5>Geography Instructor with 20+ years of experience with a background with quantitative and qualitative research and geospatial science methodology.</h5>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<h3>Skills</h3>
<h4>Technical:</h4></td>
<ul>
<li>Programming languages: C, Python, HTML, CSS, Java script</li>
<li>GIS: ArcMap, ArcGis Pro, ArcGis Online, MapTiler, QGis</li>
<li>Mapping: Google Earth Pro, Google Earth Engine, Leaflet, GPS</li>
<li>LMS: Blackboard, Angel, D2L, Moodle</li>
<li>Database management: SQL, Access, Excel, SPSS</li>
<li>General IT maintenance: Window OS, basic networking</li>
</ul>
<h4>Professional:</h4></td>
<ul>
<li>Business: owner and manager of small shop, supervisory skills</li>
<li>Demographics: US Census, ACS, CDC Data, UN Data </li>
<li>Surveys: qualitative and quantitative methods</li>
<li>Academic: Extensive geographic knowledge and scientific literacy</li>
</ul>
<h4>Communication:</h4></td>
<ul>
<li>Languages: Spanish, French, Italian</li>
<li>Published writing: Two novels, several short stories </li>
<li>Other: Many social media platforms, Blogger, Adobe Suite</li>
</ul>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<h3>Degree and Academics</h3>
<p>Master of Arts, Urban and Social Geography, honors graduate, McGill University, Montreal, Quebec, Canada</p>
<p>Other graduate course work in GIS and Geospatial Sciences</p>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<h3>Certifications</h3>
<ul>
<li>Microsoft Technology Associate: Microsoft Windows Operating System Fundamentals</li>
<li>Certificate of Completion Applying the QM Rubric (APPQMR)</li>
<li>Blackboard Certificate: Designing for Digital Teaching and Learning</li>
<li>ESRI GIS Certificates</li>
</ul>
</div>
<div class="spacing textColor borderColor backgroundColor">
<h3>Professional Experience</h3>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<table style="width:100%">
<tr>
<th>Adjunct Faculty for the Commonwealths of Massachusetts and Pennsylvania, <i>September 2000 to present</i></th>
</tr>
<tr>
<td><strong>Geographic sciences Instructor for </strong>Fitchburg State University, Salem State University, clarion University, North Shore Community College, Bunker Hill Community College, Mount Wachusett Community College.</td>
</tr>
<tr>
<td><strong>Courses:</strong> Basic Earth Science, Conservation, Weather and Climate, Weather and Climate Lab, Global Climate Change, Introduction to Geography, Political Geography, Population Geography, Cultural Geography, World Cities, Geography of Latin America, Geography of the United States, Intro to Maps and GIS, Map Design and Interpretation, Introductin ot Geospatial Sciences.</td>
</tr>
</table>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<table style="width:100%">
<tr>
<th>Field Service Technician, <i>Dec 2013 to June 2018</i></th>
</tr>
<tr>
<td>AVC Services, Inc., North Andover, MA.</td>
</tr>
<tr>
<td>Installed new hardware and software, repair of computer equipment and instructed clients on user operations.</td>
</tr>
</table>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<table style="width:100%">
<tr>
<th>Writer, Blogger, Self Employed, <i>Jan 2010 - Present</i></th>
</tr>
<tr>
<td>Developed promotional media and online resources. Published a novel and several short stories in academic and professional journals. </td>
</tr>
<tr>
<td>Developed and maintain two cultural issues blogs, The Wonders of Nature and AwareScape.</td>
</tr>
</table>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<table style="width:100%">
<tr>
<th>Business Partner and Owner of Artfunkle, llp, Clarion, PA, <i>Feb 2007 – Oct 2012</i></th>
</tr>
<tr>
<td>Management, retail sales, and coordination of a small gift shop and used bookstore .</td>
</tr>
<tr>
<td>Coordinated community and cultural events</td>
</tr>
</table>
</div>
<div class="spacing textColor borderColor backgroundGradient">
<table style="width:100%">
<tr>
<th>Application Instructor and Software Consultant for Professional Development Group, Inc., Wayland, MA <i>Dec 1997 - Aug 2000</i></th>
</tr>
<tr>
<td>Provided advanced instruction for business professionals in Windows OS, MSOffice, Word, Excel, PowerPoint, Access, Outlook, Paradox, WordPerfect, Lotus Notes, OLE and DDE processes.</td>
</tr>
<tr>
<td>Technician for Windows 95/98, NT network and workstation configuration and troubleshooting, and software installation.</td>
</tr>
<tr>
<td>Database developer and Web designer and developer.</td>
</tr>
</table>
</div>
</body>
</html>
__________________________________________________
occhipinti_assignment.html
__________________________________________________<!DOCTYPE html>
<html>
<head>
<title>Map Demo Occhipinti</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script src="./index.js"></script>
</head>
<body>
<h3>Maps Demo Occhipinti</h3>
<!--The div element for the map -->
<div id="map"></div>
<!-- Async script executes immediately and must be after any DOM elements used in callback. -->
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdCPhzNdSHvg9HxvMY797BneSbjgQoeHk
&callback=initMap&v=weekly"
async
></script>
</body>
</html>
__________________________________________________
index.js
__________________________________________________
// [START maps_add_map]
// Initialize and add the map
function initMap() {
// [START maps_add_map_instantiate_map]
// The location of map and icons
const hubb1 = { lat: 42.4790, lng: -71.94442 };
const hubb2 = { lat: 42.5, lng: -72 };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 13,
center: hubb2,
});
// [END maps_add_map_instantiate_map]
// [START maps_add_map_instantiate_marker]
// add image icon
const image ="./icon1.png"
// The marker, positioned at Uluru
const marker = new google.maps.Marker({
position: hubb1,
map: map,
icon: image,
});
// [END maps_add_map_instantiate_marker]
const homeMarker = new google.maps.Marker({
position: hubb2,
map,
});
}
// [END maps_add_map]
__________________________________________________
style.css
__________________________________________________
/* [START maps_add_map] */
/* Set the size of the div element that contains the map */
#map {
height: 800px;
/* The height is 400 pixels */
width: 100%;
/* The width is the width of the web page */
}
/* [END maps_add_map] */
import time
import pandas as pd
import numpy as np
import sys
# I have included a readme.txt file with the sources I referenced for this project.
CITY_DATA = { 'chicago': 'chicago.csv',
'new york': 'new_york_city.csv',
'washington': 'washington.csv' }
mo_names = ['january', 'february', 'march', 'april', 'may', 'june']
day_names = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday' ]
# Asks user to specify a city to analyze.
# Returns: (str) city - name of the city to analyze
def get_city():
print('\n\nHello Welcome to Joe Occhipinti\'s Bikeshare Project. Let\'s explore some US bikeshare data!')
print('\nChicago')
print('New York')
print('Washington')
print('\nPlease choose one of the above cities to analyze by typing the city\'s first letter.')
print('_'*10)
c = input('>>>').lower().strip()
while c not in ['c', 'n', 'w']: c = input('try again, enter the first letter of a city on the list >>> ').lower().strip()
if c == 'c':
city = 'Chicago'
print('\nYou chose {}\n'.format(city))
return city.lower()
if c == 'n':
city = 'New York'
print('\nYou chose {}\n'.format(city))
return city.lower()
if c == 'w':
city = 'Washington'
print('\nYou chose {}\n'.format(city))
print('_'*10, '\n')
return city.lower()
# Asks user to specify the time frame, the month, and day to analyze.
# Returns: (str) month - name of the month to filter by, or "all" to apply no month filter
# (str) day - name of the day of week to filter by, or "all" to apply no day filter
def get_time():
# get user input for month (all, january, february, ... , june)
for mo in mo_names:
print('{} for {}'.format(mo_names.index(mo), mo))
print('Enter \'all\' to analyze all the months together.\n')
print('\nPlease type \'all\' or type the number for the month you are interested in analyzing.')
month = input('>>>')
while month not in ['0','1','2','3','4','5','all']: month = input('Try again >>> ').lower().strip()
if month == 'all':
print('\nYou chose no month filter')
print('_'*10, '\n')
month = -1
else:
month =int(month)
print('\nYou chose {}'.format(mo_names[month]).title())
print('_'*10, '\n')
# get user input for day of week (all, monday, tuesday, ... sunday)
for day in day_names:
print('{} for {}'.format(day_names.index(day), day))
print('enter \'all\' to analyze all days of the week together.')
print('\nPlease type \'all\' or type a number for the day of the week you are interested in analyzing.\n')
day = input('>>>')
while day not in ['0','1','2','3','4','5','6','all']: month = input('Try again >>> ').lower().strip()
if day == 'all':
print('\nYou chose no day filter')
print('_'*10, '\n')
day = -1
else:
day =int(day)
print('\nYou chose {}'.format(day_names[day]).title())
return month, day
#modifies the data to make it usable for analysis
#returns a modified dataframe, with added columns
def load_data(city, month, day):
"""
Args:
(str) city - name of the city to analyze
(str) month - name of the month to filter by, or "all" to apply no month filter
(str) day - name of the day of week to filter by, or "all" to apply no day filter
Returns:
rider_data - Pandas DataFrame containing city data filtered by month and day
"""
#Loads data for the specified city
rider_data = pd.read_csv(CITY_DATA[city])
#rename columns
rider_data.rename(columns = {'Start Time':'start_time',
'End Time':'end_time',
'Trip Duration':'trip_duration',
'Start Station':'start_station',
'End Station':'end_station',
'User Type':'user_type'}, inplace = True)
#convert date to match filter querie
rider_data['start_time'] = pd.to_datetime(rider_data['start_time'])
#get the filter data
#create new columns
rider_data['month'] = rider_data['start_time'].dt.month
rider_data['day'] = rider_data['start_time'].dt.dayofweek
rider_data['hour'] = rider_data['start_time'].dt.hour
#apply filters
if month != -1:
rider_data = rider_data[rider_data['month'] == month]
if day != -1:
rider_data = rider_data[rider_data['day'] == day]
# show raw data if user wants to see it
start_row, end_row = 0, 5
while True:
view_raw = input('To see 5 rows of raw data click enter or type \'any key\' to skip to the analysis. \n>>> ').lower().strip()
if view_raw != '': break
print(rider_data.iloc[start_row:end_row])
start_row += 5
end_row += 5
return rider_data
#displays time statistics
#nothing to return
def time_stats(rider_data):
"""Displays statistics on the most frequent times of travel."""
print('='*60)
print('\nCalculating The Most Frequent Times of Travel...\n')
start_time = time.time()
# display the most common month
m = rider_data['month'].value_counts().idxmax()
print(' ', mo_names[m-1].title(), 'was the month most traveled.')
# display the most common day of week
d = rider_data['day'].value_counts().idxmax()
print('\n ', day_names[d-1].title(), 'was the day most traveled.')
# display the most common start hour
h = rider_data['hour'].value_counts().idxmax()
print('\n {}:00 MT, was the hour of the day was the most traveled.'.format(h))
print("\nThis took %s seconds." % (time.time() - start_time))
print('='*60)
#displays stations statistics
#nothing to return
def station_stats(rider_data):
"""Displays statistics on the most popular stations and trip."""
print('\nCalculating the Most Popular Stations and most popular combination of stations or trips...\n')
start_time = time.time()
# create a trip column
rider_data['trip'] = rider_data['start_station'] + ' -- ' + rider_data['end_station']
# display most commonly used start station, end station and combination
top_start_station = rider_data['start_station'].value_counts().idxmax()
top_end_station = rider_data['end_station'].value_counts().idxmax()
top_start_end_combo = rider_data['trip'].value_counts().idxmax()
# display results
print(' The most common start station is: {}'.format(top_start_station))
print(' The most common end station is: {}'.format(top_end_station))
print(' The most common combination or trip are: {}'.format(top_start_end_combo))
print("\nThis took %s seconds." % (time.time() - start_time))
print('='*60)
#displays trip statistics
#nothing to return
def trip_duration_stats(rider_data):
"""Displays statistics on the total and average trip duration."""
print('\nCalculating Trip Duration...\n')
start_time = time.time()
#calculte the total, mean and max travel times
tot_travel = rider_data['trip_duration'].sum()
ave_travel = rider_data['trip_duration'].mean()
#display the total, mean and max travel times
print('The total travel time is: {}'.format(tot_travel))
print('The average travel time is: {}'.format(ave_travel))
print("\nThis took %s seconds." % (time.time() - start_time))
print('='*60)
#displays user statistics
#nothing to return
def user_stats(metro_area, rider_data):
"""Displays statistics on bikeshare users."""
print('\nCalculating User Stats...\n')
start_time = time.time()
# Calculate and display counts of user types and gender
user_type_counts = rider_data['user_type'].value_counts()
for i, types in enumerate(user_type_counts):
print('There are {} {}s'.format(types, user_type_counts.index[i]))
print()
if metro_area != 'washington':
gender_counts = rider_data['Gender'].value_counts()
for i, sex in enumerate(gender_counts):
print('There are {} {}s'.format(sex, gender_counts.index[i]))
print("\nThis took %s seconds." % (time.time() - start_time))
print('='*60)
def main():
while True:
city = get_city()
month, day = get_time()
df = load_data(city, month, day)
time_stats(df)
station_stats(df)
trip_duration_stats(df)
user_stats(city, df)
restart = input('\nType <enter> to end the analysis. To continue type \'c\' and enter.\n')
if restart.lower() != 'c':
break
if __name__ == "__main__":
main()