daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas
  2. data = pandas.DataFrame({'Local':['são paulo','rio','bahia'], '01/09/2007': [1,2,0], '01/10/2007': [0,1,0], '01/11/2007': [2,1,1], '01/12/2007': [2,0,3], '01/01/2008': [0,1,1], 'contato':['2345-1244','5422-1244','2345-8674']})
  3.    
  4. data = pandas.melt(data.reset_index(), id_vars=['Local', 'contato'],
  5. var_name='mes', value_name='quantidade').sort(['Local','quantidade'], ascending=False)
  6.    
  7. data = data[data.mes.str.contains("index") == False]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top