Skip to content
View pedrovgp's full-sized avatar

Block or report pedrovgp

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. Allow upserting a pandas dataframe t... Allow upserting a pandas dataframe to a postgres table (equivalent to df.to_sql(..., if_exists='update')
    1
    # Upsert function for pandas to_sql with postgres
    2
    # https://stackoverflow.com/questions/1109061/insert-on-duplicate-update-in-postgresql/8702291#8702291
    3
    # https://www.postgresql.org/docs/devel/sql-insert.html#SQL-ON-CONFLICT
    4
    import pandas as pd
    5
    import sqlalchemy
  2. Python script to fetch stock prices ... Python script to fetch stock prices for gnucash using http://alphavantage.co/ api. Since Quotes::Finance fetching from Yahoo finance no longer works, it is an alternative.
    1
    # INSTALL DEPENDENCIES BEFORE RUNNING: pandas, sqlite3, sqlalchemy, requests
    2
    # There is one thing you have to do though: gnucash needs to know the price's currency and it needs a guid (unique identifier)
    3
    # for this. This guid is unique for each installation, so you need to find yours and assign it to CURRENCY_GUID.
    4
    # OR: you can just leave it, and the script will fetch the currency from the last price added
    5
    import pandas as pd
  3. mtg-nltk mtg-nltk Public

    Ideal: given two sets of cards, return the best deck you could build with the first set of cards, to play against one built from the second. Remember: ideal is not a goal (and best deck would be a …

    Python