<jupyter_start><jupyter_text>Additional Pandas FunctionalityAdditional things you can do with `pandas` that wasn't mentioned in the webinar.  Setup<jupyter_code>import pandas as pd
import numpy as np
df = pd.read_csv("./data_cleaned.csv")
df.head()
df["Sales ID"] = df.index + 1
df.head()<jupyter_output><empty_output><jupyter_text>Pivot Tables<jupyter_code>df.pivot_table(index="Sales Person")
df.groupby("Sales Person").sum()
df.pivot_table(index=["Sales Person", "Order Date"])<jupyter_output><empty_output><jupyter_text>Merging Data Sets<jupyter_code>df_quarter = pd.read_csv("./data_quarter.csv")
df_quarter
df = df.merge(df_quarter, on="Sales ID")
df<jupyter_output><empty_output><jupyter_text>Unique Values<jupyter_code>df["Sales Person"].unique()
pd.unique([1, 1, 2, 3, 7, 9, 2, 1])<jupyter_output><empty_output><jupyter_text>Querying<jupyter_code>df.query("Quarter == 4")
df[df.Quarter == 4]
columns = df.columns.map(lambda col: col.replace(' ', '_'))
df.columns = columns
df
df.query('Items_Sold > 1 and Quarter == 2')
df.query("(Sales_Person == 'John' or Sales_Person == 'Mary') and Item_Price > 5")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1587719298245614, 'fraction_numerical': 0.012280701754385965, 'mean_word_length': 8.128, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '484538', 'license': 'Apache-2.0', 'n_tokens_mistral': 459, 'n_tokens_neox': 428, 'n_words': 81, 'path': '2017-12-14 Data Analysis in Python with Pandas/Additional Pandas Functionality.ipynb', 'repo_name': 'derricksobrien/WintellectWebinars', 'size': '1140'}