<jupyter_start><jupyter_text>Set email as index<jupyter_code>df.set_index("email")
# df didn't actually change
df<jupyter_output><empty_output><jupyter_text>To change inplace<jupyter_code>df.set_index("email", inplace=True)
df<jupyter_output><empty_output><jupyter_text>Get all indexes<jupyter_code>df.index
df.loc["<EMAIL>"]["first"]<jupyter_output><empty_output><jupyter_text>To reset indexes<jupyter_code>df.reset_index(inplace=True)
df
df = pd.read_csv("data/survey_results_public.csv", index_col="Respondent")
schema_df = pd.read_csv("data/survey_results_schema.csv", index_col="Column")
df.head()
df.loc[1]
schema_df
schema_df.loc["Hobbyist"]
schema_df.loc["MgrIdiot","QuestionText"]
schema_df.sort_index(inplace=True)
schema_df
schema_df.sort_index(ascending=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1433915211970075, 'fraction_numerical': 0.0012468827930174563, 'mean_word_length': 14.150943396226415, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '479949', 'license': 'MIT', 'n_tokens_mistral': 323, 'n_tokens_neox': 319, 'n_words': 33, 'path': 'Corey Schefer/3- Indexes - How to Set, Reset, and Use Indexes.ipynb', 'repo_name': 'HussamCheema/pandas', 'size': '815'}