0

I'm doing some analysis on customers behaviors upon using internet banking versus offline channel.


I have imported excel database into pandas DataFrame

#Read Excel file using pandas
excel_file = 'Analytic.xlsx'
analytic = pd.read_excel(excel_file)
analytic

Result Imgur


Problems

The column THANG_COGD and amnd_state contains the number of transaction months and the status of the users whether they have internet banking or not respectively. Anyway, I want to sort the data by the column THANG_COGD that has value 0 and the column amnd_state that has value A and still print out the corresponding table

I can do this in Excel by simple creating a table and use the sort functionality in Excel to do so like shown

Imgur

As you can see the column THANG_COGD has been sorted as shown (amnd_state as well)


Questions

  1. How can I do the same thing with pandas?

P/s: this is a dummy variable so there is no worries for data exploit

3
  • I think need df = df.sort_values('THANG_COGD') Commented Aug 30, 2018 at 10:52
  • what I mean is that when I try to use df = df.sort_values('THANG_COGD') it still shows values bigger than 0. My question is that are there any ways that I can only get the value 0 in my new table? Commented Aug 30, 2018 at 11:09
  • Check if compare numeric values by print(df.dtypes) Commented Aug 30, 2018 at 11:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.