Skip to content

Instantly share code, notes, and snippets.

View cbjuan's full-sized avatar

Juan Cruz-Benito cbjuan

View GitHub Profile
@cbjuan
cbjuan / setupFastaiV1.md
Last active December 12, 2018 12:10 — forked from tcvieira/setupFastaiV1.md
Setup Fast.ai v1 on Paperspace Fast.ai Template

Setup Fastai v1 on Paperspace

Machine

  • Create a Fast.ai machine from public templates w/ P4000 and public IP
  • If you are not approved for using the P4000, request it. It deserves the waiting time (powerful than the default one with the same costs).

Connect to the machine

  • source deactivate fastai
@cbjuan
cbjuan / tweet_dumper.py
Last active September 19, 2018 18:06 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy # https://github.com/tweepy/tweepy
import csv
import json
import sys
with open('credentials/twitterCredentials.json', "r") as data_file:
data_loaded = json.load(data_file)
@cbjuan
cbjuan / useful_pandas_snippets.py
Created November 22, 2017 16:45 — 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!
@cbjuan
cbjuan / autopep8 Travis-CI.md
Last active September 13, 2017 16:50 — forked from MichaelCurrie/autopep8 Travis-CI.md
Automatically fix PEP-8 issues using Travis-CI

PEP-8 is a set of Python style recommendations. pep8 is a module that checks your .py file for violations. To make your Travis-CI build fail if you have any violations, you could add these lines to your .travis.yml:

before_install:
    - pip install pep8
    
script:
    # Run pep8 on all .py files in all subfolders
    # (I ignore "E402: module level import not at top of file"
    # because of use case sys.path.append('..'); import <module>)