Skip to content

Instantly share code, notes, and snippets.

View vincefav's full-sized avatar

Vince vincefav

View GitHub Profile
@vincefav
vincefav / chatgpt.py
Last active March 8, 2023 12:03
ChatGPT sample code
import openai
openai.api_key = 'your key here'
# Your instructions for the AI here (go ahead and be as detailed as you like!):
instructions = "You are ChatGPT, a helpful AI assistant with a sarcastic sense of humor."
class Conversation:
def __init__(self, instructions):
self.instructions = instructions
@vincefav
vincefav / bamboo.py
Last active November 4, 2020 21:39
Common data science tasks
def clean_column_names(cols):
'''
Pass your dataframe's columns into this function and it'll clean up their names.
Sample usage:
data.columns = clean_column_names(data.columns)
'''
from string import punctuation
cols = cols.str.strip().str.lower()
for i in list(punctuation):
@vincefav
vincefav / command.txt
Last active June 22, 2018 22:42
Postgres: How to restore latest.dump from Heroku to local server in Windows
Type the following from your command line:
pg_restore --no-privileges --no-owner -U postgres -d [YOUR_DB_NAME] -1 latest.dump