<jupyter_start><jupyter_text>City Bike Data 2016 - 2018<jupyter_code># Dependencies & Setup
import pandas as pd
import numpy as np
import datetime as dt
# Files to Load
july2016 = "201607-citibike-tripdata.csv"
july2017 = "201707-citibike-tripdata.csv"
july2018 = "201807-citibike-tripdata.csv"

# Read July 2016, 2017 & 2018 Citi Bike Data Files & Store into Pandas DataFrames
july2016_df = pd.read_csv(july2016, encoding="ISO-8859-1")
july2017_df = pd.read_csv(july2017, encoding="ISO-8859-1")
july2018_df = pd.read_csv(july2018, encoding="ISO-8859-1")
# Combine All Three July DataFrames from 2016-2018 Into Single DataFrame
combined_july_df = july2016_df.append([july2017_df, july2018_df], ignore_index=True)
combined_july_df.head()
# Rename Columns
combined_july_df = combined_july_df.rename(columns={"tripduration": "Trip Duration",
                                            "starttime": "Start Time",
                                            "stoptime": "Stop Time",
                                            "start station id": "Start Station ID",
                                            "start station name": "Start Station Name",
                                            "start station latitude": "Start Station Latitude",
                                            "start station longitude": "Start Station Longitude",
                                            "end station id": "End Station ID",
                                            "end station name": "End Station Name",
                                            "end station latitude": "End Station Latitude",
                                            "end station longitude": "End Station Longitude",
                                            "bikeid": "Bike ID",
                                            "usertype": "User Type",
                                            "birth year": "Birth Year",
                                            "gender": "Gender"
                                           })
combined_july_df.head()
# Convert All DateTimes to "%Y-%m-%d %H:%M:%S" Format
combined_july_df["Start Time"] = pd.to_datetime(combined_july_df["Start Time"])
combined_july_df["Stop Time"] = pd.to_datetime(combined_july_df["Stop Time"])
combined_july_df.head()
combined_july_df.dtypes
# Save Combined DataFrames to CSV
combined_july_df.to_csv("three-year-july-citibike-tripdata.csv", index=False, header=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09640522875816994, 'fraction_numerical': 0.044526143790849675, 'mean_word_length': 1.7829545454545455, 'pattern_counts': {'":': 15, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '234264', 'license': 'MIT', 'n_tokens_mistral': 730, 'n_tokens_neox': 625, 'n_words': 163, 'path': 'citi_bike_ETL.ipynb', 'repo_name': 'bigbluey/Citi-Bike-Analytics', 'size': '2448'}