|
96 | 96 | "metadata": {
|
97 | 97 | "id": "RFBb6m_momYt",
|
98 | 98 | "colab_type": "code",
|
| 99 | + "outputId": "6a2a88fb-611c-4110-9b91-9b50e3f69010", |
99 | 100 | "colab": {
|
100 | 101 | "base_uri": "https://localhost:8080/",
|
101 | 102 | "height": 225
|
102 |
| - }, |
103 |
| - "outputId": "6a2a88fb-611c-4110-9b91-9b50e3f69010" |
| 103 | + } |
104 | 104 | },
|
105 | 105 | "source": [
|
106 | 106 | "!pip install pytrends"
|
107 | 107 | ],
|
108 |
| - "execution_count": 26, |
| 108 | + "execution_count": 0, |
109 | 109 | "outputs": [
|
110 | 110 | {
|
111 | 111 | "output_type": "stream",
|
|
224 | 224 | "metadata": {
|
225 | 225 | "id": "8MB0udCqpD7T",
|
226 | 226 | "colab_type": "code",
|
| 227 | + "outputId": "e8bdf609-14a6-45e3-b840-d6c0ef914dfa", |
227 | 228 | "colab": {
|
228 | 229 | "base_uri": "https://localhost:8080/",
|
229 | 230 | "height": 386
|
230 |
| - }, |
231 |
| - "outputId": "e8bdf609-14a6-45e3-b840-d6c0ef914dfa" |
| 231 | + } |
232 | 232 | },
|
233 | 233 | "source": [
|
234 | 234 | "pytrend.build_payload(kw_list=['Taylor Swift'])\n",
|
235 | 235 | "# Interest by Region\n",
|
236 | 236 | "df = pytrend.interest_by_region()\n",
|
237 | 237 | "df.head(10)"
|
238 | 238 | ],
|
239 |
| - "execution_count": 28, |
| 239 | + "execution_count": 0, |
240 | 240 | "outputs": [
|
241 | 241 | {
|
242 | 242 | "output_type": "execute_result",
|
|
361 | 361 | "metadata": {
|
362 | 362 | "id": "Jv5fd7PBpUEQ",
|
363 | 363 | "colab_type": "code",
|
| 364 | + "outputId": "6bf1a66f-368b-4048-b53b-9ae44b20f1a8", |
364 | 365 | "colab": {
|
365 | 366 | "base_uri": "https://localhost:8080/",
|
366 | 367 | "height": 837
|
367 |
| - }, |
368 |
| - "outputId": "6bf1a66f-368b-4048-b53b-9ae44b20f1a8" |
| 368 | + } |
369 | 369 | },
|
370 | 370 | "source": [
|
371 | 371 | "df.reset_index().plot(x='geoName', y='Taylor Swift', figsize=(120, 10), kind ='bar')"
|
372 | 372 | ],
|
373 |
| - "execution_count": 29, |
| 373 | + "execution_count": 0, |
374 | 374 | "outputs": [
|
375 | 375 | {
|
376 | 376 | "output_type": "execute_result",
|
|
430 | 430 | "metadata": {
|
431 | 431 | "id": "CZxlpg2Vphiv",
|
432 | 432 | "colab_type": "code",
|
| 433 | + "outputId": "53369134-c52f-481d-9f5a-e033d235c435", |
433 | 434 | "colab": {
|
434 | 435 | "base_uri": "https://localhost:8080/",
|
435 | 436 | "height": 202
|
436 |
| - }, |
437 |
| - "outputId": "53369134-c52f-481d-9f5a-e033d235c435" |
| 437 | + } |
438 | 438 | },
|
439 | 439 | "source": [
|
440 | 440 | "# Get Google Hot Trends data\n",
|
441 | 441 | "df = pytrend.trending_searches(pn='united_states')\n",
|
442 | 442 | "df.head()"
|
443 | 443 | ],
|
444 |
| - "execution_count": 30, |
| 444 | + "execution_count": 0, |
445 | 445 | "outputs": [
|
446 | 446 | {
|
447 | 447 | "output_type": "execute_result",
|
|
562 | 562 | "metadata": {
|
563 | 563 | "id": "RR8sdilxp0TP",
|
564 | 564 | "colab_type": "code",
|
| 565 | + "outputId": "8b8f1dce-a548-4ebf-e601-3a7b524db80a", |
565 | 566 | "colab": {
|
566 | 567 | "base_uri": "https://localhost:8080/",
|
567 | 568 | "height": 202
|
568 |
| - }, |
569 |
| - "outputId": "8b8f1dce-a548-4ebf-e601-3a7b524db80a" |
| 569 | + } |
570 | 570 | },
|
571 | 571 | "source": [
|
572 | 572 | "# Get Google Top Charts\n",
|
573 | 573 | "df = pytrend.top_charts(2019, hl='en-US', tz=300, geo='GLOBAL')\n",
|
574 | 574 | "df.head()"
|
575 | 575 | ],
|
576 |
| - "execution_count": 32, |
| 576 | + "execution_count": 0, |
577 | 577 | "outputs": [
|
578 | 578 | {
|
579 | 579 | "output_type": "execute_result",
|
|
681 | 681 | "metadata": {
|
682 | 682 | "id": "phF_2PZxqETV",
|
683 | 683 | "colab_type": "code",
|
| 684 | + "outputId": "e1944072-ae5e-40c7-bb38-cd8e8cc0dc37", |
684 | 685 | "colab": {
|
685 | 686 | "base_uri": "https://localhost:8080/",
|
686 | 687 | "height": 202
|
687 |
| - }, |
688 |
| - "outputId": "e1944072-ae5e-40c7-bb38-cd8e8cc0dc37" |
| 688 | + } |
689 | 689 | },
|
690 | 690 | "source": [
|
691 | 691 | "# Get Google Keyword Suggestionskeywords = pytrend.suggestions(keyword='Mercedes Benz')\n",
|
692 | 692 | "df = pd.DataFrame(keywords)\n",
|
693 | 693 | "df.drop(columns= 'mid') # This column makes no sense"
|
694 | 694 | ],
|
695 |
| - "execution_count": 33, |
| 695 | + "execution_count": 0, |
696 | 696 | "outputs": [
|
697 | 697 | {
|
698 | 698 | "output_type": "execute_result",
|
|
806 | 806 | "metadata": {
|
807 | 807 | "id": "t1h_k1o3qL1o",
|
808 | 808 | "colab_type": "code",
|
| 809 | + "outputId": "edb93ab5-f9c6-43d7-b332-99058f4299cb", |
809 | 810 | "colab": {
|
810 | 811 | "base_uri": "https://localhost:8080/",
|
811 | 812 | "height": 901
|
812 |
| - }, |
813 |
| - "outputId": "edb93ab5-f9c6-43d7-b332-99058f4299cb" |
| 813 | + } |
814 | 814 | },
|
815 | 815 | "source": [
|
816 | 816 | "# Related Queries, returns a dictionary of dataframes\n",
|
817 | 817 | "related_queries = pytrend.related_queries()\n",
|
818 | 818 | "related_queries.values()"
|
819 | 819 | ],
|
820 |
| - "execution_count": 35, |
| 820 | + "execution_count": 0, |
821 | 821 | "outputs": [
|
822 | 822 | {
|
823 | 823 | "output_type": "execute_result",
|
|
0 commit comments