Giter VIP home page Giter VIP logo

Comments (1)

ShellMonster avatar ShellMonster commented on May 10, 2024

+1,

这个我在源码中看到了有个“geo”的参数,是指定国别的,可否直接开放为可选参数,允许指定;

原代码:

def google_index(keyword="python", start_date="2019-12-01", end_date="2019-12-04"):
    """
    返回指定区间的谷歌指数
    :param keyword:
    :param start_date:  2019-12-10T10
    :param end_date:    2019-12-10T23
    :return:
    """
    try:
        pytrends = TrendReq(hl="en-US", tz=360)
        kw_list = [keyword]
        pytrends.build_payload(
            kw_list, cat=0, timeframe=start_date + " " + end_date, geo="", gprop=""
        )
        search_df = pytrends.interest_over_time()
        search_df['value'] = search_df[keyword]
        search_df['date'] = search_df.index
        res_df = search_df.drop(['isPartial', keyword], axis=1)
        return res_df
    except:
        return None

from gopup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.