Formatting categories of data with pandas in Python
This is how I would do it. However, a DataFrame can be structured in a number of way which best suits your needs. I believe that this method allows for the greatest flexibility because you can easily use grouping functions to restructure this format on the go. 

First you need to set up your data in a way that is compatible with Python. I use a dictionary of dictionaries

cities = {'Lovell_Wyoming':
          {'Crimes':
           {
            'Arson': [0, 0, 0, 0, 0, 0, 0, 1, 0],
            'Assaults': [6, 6, 3, 4, 3, 28, 3, 2, 2] ,
            'Auto_thefts': [1, 1, 1, 0, 0, 1, 2, 0, 1] ,
            'Burglaries': [6, 11, 5, 2, 0, 15, 11, 7, 7] ,
            'Murders': [0, 0, 0, 0, 1, 0, 0, 0, 0] ,
            'Rapes': [0, 0, 3, 0, 0, 1, 1, 0, 1] ,
            'Robberies': [0, 0, 0, 0, 0, 0, 0, 1, 0] ,
            'Thefts': [23, 49, 35, 39, 28, 37, 54, 35, 10]
           },
            'Years': [2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2014]
          },

         'Wheatland_Wyoming':
          {'Crimes':
           {
            'Arson': [0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0] ,
            'Assaults': [9, 2, 6, 5, 6, 6, 2, 4, 2, 4, 3, 11, 5, 4, 8] ,
            'Auto_thefts': [4, 8, 3, 3, 4, 4, 5, 3, 4, 6, 4, 8, 12, 7, 3] ,
            'Burglaries': [17, 17, 14, 9, 10, 17, 12, 26, 51, 12, 15, 21, 32, 31, 13] ,
            'Murders': [1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0] ,
            'Rapes': [0, 0, 0, 4, 2, 1, 2, 0, 2, 1, 1, 0, 2, 0, 0] ,
            'Robberies': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ,
            'Thefts': [109, 95, 146, 81, 108, 100, 82, 85, 106, 128, 48, 85, 66, 56, 47]
            },
              'Years': [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016]
            }
         }


Then compile this data into rows of your DataFrame

data = []
for city in cities:
    for ix, year in enumerate(cities[city]['Years']):
        for crime in cities[city]['Crimes']:
            temp = {'City':city, 
                    'Crime':crime, 
                    'Year':year, 
                    'Count':cities[city]['Crimes'][crime][ix]}
            data.append(temp)


Then into the DataFrame structure as.

import pandas as pd
df = pd.DataFrame(data=data)
df






Queries

You can then query this DataFrame in a number of ways for example if you want to know arsons in 2002 you would do 

df[(df['Crime']=='Arson') &amp; (df['Year']==2002)]




Counting

You can count the number of arsons throughout the years as

df[(df['Crime']=='Arson')].groupby(['City'])['Count'].agg('sum')



  City Lovell_Wyoming       1 Wheatland_Wyoming    3 Name: Count, dtype:
  int64




Writing your DataFrame to a CSV file

This can be done directly as 

df.to_csv('filename.csv')