GeoMapper, Python Script for Visualizing Data on Social Networks with Geo-location data

8,790 views

Published on

This lecture was presented at the XXVI Pernambuco's Python User Group meeting at 06.04.2013

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,790
On SlideShare
0
From Embeds
0
Number of Embeds
5,214
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

GeoMapper, Python Script for Visualizing Data on Social Networks with Geo-location data

  1. GeoLocation Friends Visualizer Plotting your location social network dataMarcel Caraciolo@marcelcaracioloDeveloper, Cientist, contributor to the Crab recsys project,works with Python for 6 years, interested at mobile,education, machine learning and dataaaaa!Recife, Brazil - http://aimotion.blogspot.com
  2. How your friends are connected ?
  3. How your friends are connected ?Where are they ?
  4. Atépassar snapshot 300k users - March 2013
  5. Can I use it ??? Please!
  6. Of course!https://github.com/marcelcaraciolo/Geo-Friendship-Visualization
  7. Of course!if  __name__  ==  __main__:        parser  =  OptionParser(usage=SUPPRESS_USAGE)        print  geocialMapper  v.%snBy  %sn  %(__version__,__author__)        print  "Type  -­‐-­‐help  parameter  for  help.n"        parser.add_option(-­‐i,-­‐-­‐input-­‐file,dest=input_file,                                              help=Pickle  object  file  with  coordinates  and  quantity)        parser.add_option(-­‐s,-­‐-­‐size,dest=size,                                              help=image  dimmensions  height,width)        parser.add_option(-­‐o,  -­‐-­‐output-­‐file,  dest=output_file,  default=  map.jpg,                                              help=Output  file  for  saving  the  image)        parser.add_option(-­‐c,  -­‐-­‐colormap,  dest=mode,  default=wb,                                              help=Mode  of  colormap  used:  wb,  all)        parser.add_option(-­‐p,  -­‐-­‐connection,  dest=n_connections,  default=0,  type=int,                                              help=  Threshold  for  the  number  of  interconnections  between  cities)        (options,args)  =  parser.parse_args()        if  not  options.input_file:                parser.error(You  must  specifiy  a  valid  pickle  object  to  load  data  (-­‐i  parameter)  !)        if  not  options.size:                parser.error(You  must  specifiy  the  dimmensions  of  the  image  (-­‐s  parameter)  !)        run_main(options)
  8. Of course!$  python  geo_mapper.py  -­‐i    data.pk    -­‐s  1600,1600    -­‐o    output_map.jpg {  ((latO,longO),(latD,longD)):  qtd,  ...} #(latO,longO)  are  the  latitude  and  longitude  of   the  origin  location.  Both  are  float  values. #(latD,longD)  ate  the  latitude  and  longitude  of   the  destiny  location.  Both  are  float  values. #qtd:  An  integer  that  represents  the  number  of   connections  between  both  coordinates  (cities).
  9. Code available!https://github.com/marcelcaraciolo/Geo-Friendship-Visualization
  10. GeoLocation Friends Visualizer Plotting your location social network dataMarcel Caraciolo@marcelcaracioloDeveloper, Cientist, contributor to the Crab recsys project,works with Python for 6 years, interested at mobile,education, machine learning and dataaaaa!Recife, Brazil - http://aimotion.blogspot.com

×