analysis.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. from taipy import Gui
  2. import pandas as pd
  3. from taipy.gui import builder as tgb
  4. import plotly.graph_objects as go
  5. import plotly.offline as pyo
  6. data = pd.read_csv('data/aggregate/aggregate.csv')
  7. location_counts = data['location'].value_counts(sort=True)
  8. location_fig = go.Figure(data=go.Bar(x=location_counts.index, y=location_counts.values))
  9. location_fig.update_layout(title_text='Location counts', xaxis_title='index', yaxis_title='values')
  10. # md='''
  11. # # Analysis of sourced data
  12. # <|{location_counts}|chart|type=bar|x=index|y=values|>'''
  13. # Figures are as observed on March 18, 2024
  14. demand={
  15. "python developer": 7947,
  16. "data analyst": 5221,
  17. "machine learning engineer": 27829,
  18. "software engineer": 46596,
  19. "backend developer": 18583,
  20. "devops engineer": 1785,
  21. "automation engineer": 12976,
  22. "network engineer": 10513,
  23. "vuejs developer": 1444,
  24. "react developer": 6112,
  25. "nodejs developer": 4883,
  26. "frontend developer": 12399,
  27. "full stack developer": 7006,
  28. "ui developer": 9303,
  29. "web application developer": 19582,
  30. "javascript engineer": 6797,
  31. "mobile app developer": 4191,
  32. }
  33. demand = pd.DataFrame.from_dict(demand, orient = 'index', columns=['demand'])
  34. demand.reset_index(inplace=True)
  35. demand.columns=['Query','Demand']
  36. with tgb.Page() as analysis_page:
  37. tgb.text('Analysis of sourced data',class_name='h1')
  38. tgb.html('br')
  39. tgb.text('Demand of jobs as sourced on 18 March 2024.', class_name='h4')
  40. with tgb.part('card'):
  41. tgb.text('Demand of jobs sourced')
  42. tgb.table('{demand}')
  43. #tgb.html()
  44. # todo : add the plotly charts - store as image then use html(md is hard, no docs for py)
  45. #Gui(analysis_page).run()