This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type the following from your command line: | |
pg_restore --no-privileges --no-owner -U postgres -d [YOUR_DB_NAME] -1 latest.dump |