Twitter JSON में भौगोलिक डेटा

Python में सोशल मीडिया डेटा का विश्लेषण

Alex Hanna

Computational Social Scientist

Twitter टेक्स्ट में लोकेशन

स्थान वाले टेक्स्ट वाला ट्वीट

Python में सोशल मीडिया डेटा का विश्लेषण

यूज़र-परिभाषित लोकेशन

यूज़र-परिभाषित लोकेशन

print(tweet['user']['location'])
Bay Area
Python में सोशल मीडिया डेटा का विश्लेषण

place JSON

बाउंडिंग बॉक्स चित्रण

print(tweet['place'])
{'attributes': {},
 'bounding_box': {'coordinates': 
  [[[-80.47611, 37.185195],
    [-80.47611, 37.273387],
    [-80.381618, 37.273387],
    [-80.381618, 37.185195]]],
  'type': 'Polygon'},
 'country': 'United States',
 'country_code': 'US',
 'full_name': 'Blacksburg, VA',
 'name': 'Blacksburg',
 'place_type': 'city',
 ...}
Python में सोशल मीडिया डेटा का विश्लेषण

सेंट्रॉइड निकालना

बाउंडिंग बॉक्स चित्रण

coordinates = [
    [-80.47611, 37.185195],
    [-80.47611, 37.273387],
    [-80.381618, 37.273387],
    [-80.381618, 37.185195]]

longs = np.unique( [x[0] for x 
    in coordinates] )
lats  = np.unique( [x[1] for x 
    in coordinates] )

central_long = np.sum(longs) / 2
central_lat  = np.sum(lats) / 2
Python में सोशल मीडिया डेटा का विश्लेषण

coordinates JSON

एकल-कोऑर्डिनेट वाला स्थान

print(tweet['coordinates'])
{'type': 'Point', 
'coordinates': [-72.2833, 
                 21.7833]}
Python में सोशल मीडिया डेटा का विश्लेषण

अभ्यास करते हैं!

Python में सोशल मीडिया डेटा का विश्लेषण

Preparing Video For Download...