Skip to content

Instantly share code, notes, and snippets.

View ashwinvarghese's full-sized avatar

Ashwin Varghese ashwinvarghese

  • bangalore,karnataka ,india
View GitHub Profile
@ashwinvarghese
ashwinvarghese / twitter crawler.txt
Created January 5, 2019 16:59 — forked from vickyqian/twitter crawler.txt
A Python script to download all the tweets of a hashtag into a csv
import tweepy
import csv
import pandas as pd
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@ashwinvarghese
ashwinvarghese / useful_pandas_snippets.py
Created September 23, 2018 07:52 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.