<jupyter_start><jupyter_text>The and operator can only handel one bool value at a time as True and True<jupyter_code>df[(df['W'] > 0) & (df['Y'] > 1)]
df.reset_index()
df.reset_index(inplace=True)
df
df.drop('index',axis=1,inplace=True)
df
df['new'] = ['a','b','c','d','e']
df.set_index('new', inplace=True)
df
outside = ['G1','G1','G1','G2','G2','G2']
inside = [1,2,3,1,2,3]
hier_index = list(zip(outside,inside))
hier_index
hier_index = pd.MultiIndex.from_tuples(hier_index)
hier_index
df = pd.DataFrame(np.random.randn(6,2),hier_index,['A','B'])
df
df.loc['G1']
df.loc['G2'].loc[3]
df.index.names = ['Collage','Department']
df
df.loc['G2'].loc[3]['B']
df.xs('G1')
df.xs(1,level='Department')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24171270718232044, 'fraction_numerical': 0.03314917127071823, 'mean_word_length': 8.294871794871796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '439013', 'license': 'Apache-2.0', 'n_tokens_mistral': 333, 'n_tokens_neox': 324, 'n_words': 50, 'path': '2.Python for Data Analysis - Pandas/Dataframe.ipynb', 'repo_name': 'Mahesh-Shirsath/Python-for-Machine-Learning', 'size': '724'}