non-null values non-null values dtypesfloat ( as you recallthe trick is then to set the appropriate entries of each row to lastly joining this with datafor rowcat in zip(data indexdata category)codes get_code(to_cat_list(cat)dummy_frame ix[rowcodes data data join(dummy_frame add_prefix('category_')data finally now has new columns likein [ ]data ix[: : out[ ]int index entries to data columnscategory_ non-null values category_ non-null values category_ non-null values category_ non-null values category_ non-null values dtypesfloat ( let' make some plotsas this is spatial datawe' like to plot the data by category on map of haiti the basemap toolkit (to matplotlibenables plotting data on maps in python basemap provides many different globe projections and means for transforming projecting latitude and longitude coordinates on the globe onto two-dimensional matplotlib plot after some trial and error and using the above data as guidelinei wrote this function which draws simple black and white map of haitifrom mpl_toolkits basemap import basemap import matplotlib pyplot as plt def basic_haiti_map(ax=nonelllat= urlat= lllon=- urlon=- )create polar stereographic basemap instance basemap(ax=axprojection='stere'lon_ =(urlon lllon lat_ =(urlat lllat llcrnrlat=lllaturcrnrlat=urlatllcrnrlon=lllonurcrnrlon=urlonresolution=' 'draw coastlinesstate and country boundariesedge of map drawcoastlines( drawstates( drawcountries(return the ideanowis that the returned basemap objectknows how to transform coordinates onto the canvas wrote the following code to plot the data observations for number plotting mapsvisualizing haiti earthquake crisis data www it-ebooks info