treemap2.py 330 B

1234567891011121314
  1. # libraries
  2. import matplotlib.pyplot as plt
  3. import squarify # pip install squarify (algorithm for treemap)
  4. import pandas as pd
  5. # Create a data frame with fake data
  6. df=pd.read_csv('../docs/keyword.csv')
  7. r = df.head()
  8. # # plot it
  9. # squarify.plot(sizes=df['nb_people'], label=df['group'], alpha=.8 )
  10. # r = df.head()
  11. # print(r)