<jupyter_start><jupyter_text>UBER Pickups  PREPROCESSING<jupyter_code># Importing useful librairies

import pandas as pd
from datetime import datetime<jupyter_output><empty_output><jupyter_text>GETTING ACQUAINTED WITH THE DATASET<jupyter_code>dataset = pd.read_csv("uber-raw-data-sep14.csv")
dataset.head()
# Compute usefull statistics 

dataset.describe(include = 'all')
# Dropping columns that won't be useful for the analysis

dataset.drop("Base", axis = 1, inplace = True)
dataset.head()
dataset.info()
# Converting the 'Date/Time' column in datetime type to extract year, month, day, hour
dataset['Date/Time'] = pd.to_datetime(dataset['Date/Time'], format = "%m/%d/%Y %H:%M:%S")
dataset["day"] = dataset['Date/Time'].dt.day
dataset["hour"] = dataset['Date/Time'].dt.hour
dataset["weekofyear"] = dataset['Date/Time'].dt.weekofyear
dataset["dayofweek"] = dataset['Date/Time'].dt.dayofweek
dataset.head()<jupyter_output><ipython-input-13-04dd0d56ad30>:5: FutureWarning: Series.dt.weekofyear and Series.dt.week have been deprecated.  Please use Series.dt.isocalendar().week instead.
  dataset["weekofyear"] = dataset['Date/Time'].dt.weekofyear<jupyter_text>SELECTING ONE PARTICULAR DAY AND ONE PARTICULAR HOUR FOR THE ANALYSIS<jupyter_code># We want to keep the data for the 1st of September at 6pm only

mask = (dataset["day"] == 1) & (dataset['hour'] == 18)
dataset_day_hour = dataset.loc[mask, :]
dataset_day_hour = dataset_day_hour.reset_index(drop = True)
dataset_day_hour.head()
# We drop the time columns, we only study the localization of the driver
to_drop = ["Date/Time", "day", "hour", "weekofyear", "dayofweek"]
dataset_day_hour = dataset_day_hour.drop(to_drop, axis = 1)
dataset_day_hour.head()
# Saving this data in a new csv for clustering
dataset_day_hour.to_csv('uber_pickups_1_09_6PM.csv', index = False)<jupyter_output><empty_output><jupyter_text>SELECTING A WEEK FOR THE ANALYSIS<jupyter_code># We want to keep the data for the week 36 only

mask = dataset["weekofyear"] == 36
dataset_week = dataset.loc[mask, :]
dataset_week = dataset_week.reset_index(drop = True)
dataset_week.head()
# We drop the time columns, we only study the localization of the driver
to_drop = ["Date/Time", "day", "hour", "weekofyear"]
dataset_week = dataset_week.drop(to_drop, axis = 1)
dataset_week.head()
# Saving this data in a new csv for clustering
dataset_week.to_csv('uber_pickups_week36.csv', index = False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12893982808022922, 'fraction_numerical': 0.012279983626688497, 'mean_word_length': 6.590062111801243, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '531295', 'license': 'Apache-2.0', 'n_tokens_mistral': 861, 'n_tokens_neox': 819, 'n_words': 212, 'path': 'Uber_Pickups_Preprocessing.ipynb', 'repo_name': 'GunH-colab/UCS-21', 'size': '2443'}