Data scientists mould data in various ways to unearth insights from it. And since these outcomes are used for decision-making, it is paramount for data scientists to write production-level code well. However, sometimes, the practices data scientists implement are tedious to utilise in production.\u00a0\n\nData scientists often write code to evaluate the data by exploratory data analysis, check several data points, and outliers. These algorithms are only good for getting an idea about how data is spread, but are mostly purposeless in production.\n\nBesides, the algorithms come back from the production team to data scientists for making changes in them to add features or optimise the code for improved efficiency. Such practices are cumbersome and ineffective in this highly competitive marketplace.\u00a0\n\nNow, with an app framework called Streamlit, data scientists can build machine learning tools right from the beginning of the project. Utilising Streamlit, data scientists can visualise their code output while analysing data. They can build ML tools that can be utilised to analyse data through clicks and sliding bars.\n\nTo demonstrate its capabilities, we have made a simple tool to visualise through bar graph using Streamlit.\n\nWe downloaded the data from Kaggle, which contains information about football players from the FIFA database.\u00a0\n\nIn this small project, we will select two players of different teams and visualise their ranking, overall, and age in bar graphs.\u00a0\n\nHere are the steps to make you script to tool with Streamlit framework:\n\nWe have used sublime to write the Python code and used the anaconda terminal to run the Python file using streamlit run. This will open a server on your browser, where you can interact with the user interface.\n\nBegin with installing and importing the Streamlit.\n\npip install streamlit\nimport streamlit as st\n\nNote: We also imported other required libraries such as pandas, matplotlib, numpy.\n\nNow just like any other data analysis project, you can proceed while utilising Streamlit methods.\n\nWhile you can read the csv file into a pandas dataframe, it is recommended to do it with the below code when you are using Streamlit.\n\ndf = st.cache(pd.read_csv)(\u201cnew_data.csv)\n\nAfter reading the csv file, visualise the dataframe with the below code:\n\nis_check = st.checkbox(\u201cDisplay Data\u201d)\nif is_check:\nst.write(df)\n\nNote: If in case, it doesn\u2019t show the data, you can refresh the tab.\n\n \n\nNow, to create a field to input values, add this code in the Python file and refresh your tab.\n\nteams = st.sidebar.multiselect("Enter clubs", df['club'].unique())\nst.write("Your input clubs", teams)\n\nYou will witness a field, where you can select from the drop-down, or type in the names of teams.\n\n\n\nHere, we have entered two teams: Manchester United and Manchester City\n\nNext, to enter the attributes we want to compare we will input the variables.\n\nvariables = st.sidebar.multiselect("Enter the variables", df.columns)\nst.write("You selected these variables", variables)\n\n\n\nUsing the team name and variables we provided, we can further subset the data to only focus on the information we need\n\nselected_club_data = df[(df['club'].isin(teams))]\ntwo_clubs_data = selected_club_data[variables]\nclub_data_is_check = st.checkbox("Display the data of selected clubs")\nif club_data_is_check:\nst.write(two_clubs_data)\n\n\n\nEventually, we can input the name of the players to visualise their attributes.\n\nselected_players = st.sidebar.multiselect('Select players to compare', two_clubs_data.name.unique())\nst.write("The players are", selected_players)\n\n\n\nNow, we can further trim down the data to get details of only these two selected players\n\nplot_data = two_clubs_data[(two_clubs_data['name']).isin(selected_players)]\nst.write(plot_data)\n\nVisualising the ranking of the two players\n\nst.bar_chart(plot_data.name)\n\n\n\nFinally, to visualise through a bar graph.\n\nn = 2\nvalues = plot_data.values\nvalue1 = values[1:]\nvalue2 = values[1:]\nindex = np.arange(2)\nwidth = 0.3\np1 = plt.bar(index, value1, width)\np2 = plt.bar(index+width, value2, width)\nplt.xlabel("Variables")\nplt.ylabel("Value")\nplt.xticks(index, ('Potential', 'age'))\nplt.legend(values[:,0])\nst.pyplot()\n\n\n\nWe can further add more variables and players to make the visualisation complex by making little tweaks in the Python code, but this will help you get started with the Streamlit.\u00a0\n\nYou can read the documentation and implement other methods for making an intuitive machine learning tool here.