<jupyter_start><jupyter_text>print(df1.set_index('director').set_index('title', append=True))<jupyter_code>df1.set_index('director').set_index('title', append=True).loc['<NAME>cock']
df1.set_index(['director', 'title'])
df1.set_index(['director', 'title']).loc['<NAME>':'<NAME>']
df1.set_index(['director', 'title']).sort_index().loc['<NAME>':'<NAME>']
df1.set_index(['director', 'title']).sort_index()
df1.groupby(['director', 'title']).first()
df1.groupby(['director', 'title']).first()
#
# Official diagram generation
#

open('u__tyd.html', 'w').write(df1.to_html())
open('u_d_ty.html', 'w').write(df1.set_index('director').to_html())
open('u_dt_y.html', 'w').write(df1.set_index('director').set_index('title', append=True).to_html())
open('s_d_ty.html', 'w').write(df1.set_index('director').sort_index().to_html())
open('s_dt_y.html', 'w').write(df1.set_index('director').set_index('title', append=True).sort_index().to_html())

print(
    df1.set_index('director').set_index('title', append=True).equals(
    df1.set_index(['director', 'title'])
    ))

print(
    df1.set_index(['director', 'title']).sort_index().equals(
    df1.groupby(['director', 'title']).first()
    ))

print(
    df1.set_index('director').sort_index().set_index('title', append=True).equals(
    df1.groupby(['director', 'title']).first()
    ))
df1.set_index('director').sort_index().set_index('title')
df1.set_index(['director', 'title']).loc['<NAME>']
df1.set_index(['director', 'title']).reset_index('title')
df1.set_index(['director', 'title']).reset_index(['director', 'title'])
df1
df2.unstack(level=0)
df2.transpose()
df2.ix['<NAME>']
df2.ix['<NAME>',3]
df1.groupby('director')['year'].agg([('first_year', min), ('last_year', max)])
df1.groupby('director').agg({'title': min, 'year': max})
df3 = df1.groupby(['director', 'title']).first()
df3
df4 = df1.groupby(['director', 'year']).first()
df4
df1.groupby(['director', 'title', 'year']).first()
s1 = df1.stack()
s1
s2 = df1.unstack()
s2
df3.stack()
df3.unstack()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2608267716535433, 'fraction_numerical': 0.02312992125984252, 'mean_word_length': 8.368663594470046, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '270320', 'license': 'MIT', 'n_tokens_mistral': 813, 'n_tokens_neox': 783, 'n_words': 85, 'path': 'images/Diagrams.ipynb', 'repo_name': 'wicky85/pycon-pandas-tutorial', 'size': '2100'}