0

I have this huge database Sentiments.csv of 64296 entries. enter image description here

I have used:

    df=pd.read_csv("Sentiment.csv")
    df1=pd.DataFrame(df["App"])
    df1["Sent"]=df["Sentiment"]
    df1["Reviews"]=df["Translated_Review"]
    

to put it into a data frame, which looks like below: (The Sent column (It has 3 unique values [Positive,Negative,Neutral] which isn't visible here check the above screenshot for reference,There are 1074 unique App names, I couldn't display the whole dataframe here for obvious reasons):

                               App  ...                                                 Reviews
0            10 Best Foods for You  ...  I like eat delicious food. That's I'm cooking ...
1            10 Best Foods for You  ...    This help eating healthy exercise regular basis
2            10 Best Foods for You  ...                                                NaN
3            10 Best Foods for You  ...         Works great especially going grocery store
4            10 Best Foods for You  ...                                       Best idea us
5            10 Best Foods for You  ...                                           Best way
6            10 Best Foods for You  ...                                            Amazing
7            10 Best Foods for You  ...                                                NaN
                           ...  ...                                                ...
64287  Houzz Interior Design Ideas  ...                                                NaN
64288  Houzz Interior Design Ideas  ...                                                NaN
64289  Houzz Interior Design Ideas  ...                                                NaN
64290  Houzz Interior Design Ideas  ...                                                NaN
64291  Houzz Interior Design Ideas  ...                                                NaN
64292  Houzz Interior Design Ideas  ...                                                NaN
64293  Houzz Interior Design Ideas  ...                                                NaN
64294  Houzz Interior Design Ideas  ...                                                NaN

I want to Generate an interface in Tkinter where we can see the respective reviews categorized as Sentiments - positive, negative and neutral after we have selected the App from a list of apps in the same dataframe.

Since the number unique of apps is huge I couldn't even display the same number of labels and buttons for it check out my post, to which I can use groupby functions. I couldn't also figure out the groupby statement that I should use here. I was thinking of calling Pandas table everytime I select an app and then display its respective Reviews sentiment wise eg:

____________________________________
|         |Positive|Negative|Neutral|
__________ ________ ________ _______
|Reviews__|good    |bad     |okay   |
             .        .        .
             .        .        .
             .        .        .
         
__________|________|________|_______|

I'm new to Python any help would be appreciable, I want to add this interface in my project.

Community
  • 1
  • 1
Aditya Patil
  • 123
  • 1
  • 1
  • 9
  • doing all from scratch may need some work. Maybe see [pandastable](https://github.com/dmnfarrell/pandastable) – furas Jan 10 '20 at 01:08
  • 1
    This looks pretty straight forward. All you need is a couple `ttk.Combobox` with values set to unique values of each column, query the dataframe using the selected values, and display it (perhaps using a `ttk.Treeview`). – Henry Yik Jan 10 '20 at 02:59
  • Can you tell me the code for Grouping those values. I cant figure it out. – Aditya Patil Jan 10 '20 at 03:55
  • 1
    I had recently answered a similar question [here](https://stackoverflow.com/questions/59644172/how-to-create-a-button-or-option-which-allows-a-user-to-filter-a-treeview-based/59646921#59646921). You can take a look and adapt to your needs. – Henry Yik Jan 10 '20 at 06:33

0 Answers0