Python Forum
hi guys, I got data reader error while pulling the data from yahoo
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hi guys, I got data reader error while pulling the data from yahoo
#1
This error which I got, I am using python 3
[Image: error.jpg]

Thanks in advance!! Smile
Reply
#2
It's wrong import for DataReader.
Try to use code tag and not image.
>>> import pandas_datareader.data as web
>>>
>>> web.DataReader('PG', data_source='yahoo', start='2015-1-1')
                  High         Low        Open       Close     Volume   Adj Close
Date
2015-01-02   91.000000   89.919998   90.839996   90.440002  7251400.0   76.282951
2015-01-05   91.000000   89.849998   90.230003   90.010002  8626100.0   75.920288
2015-01-06   90.559998   89.260002   90.309998   89.599998  7791200.0   75.574463
2015-01-07   90.370003   89.559998   89.940002   90.070000  5986600.0   75.970879
2015-01-08   91.230003   90.129997   90.480003   91.099998  6823300.0   76.839638
...                ...         ...         ...         ...        ...         ...
2020-05-08  116.300003  113.389999  113.519997  115.949997  9283100.0  115.949997
2020-05-11  116.010002  114.919998  115.750000  115.309998  6946300.0  115.309998
2020-05-12  115.900002  114.139999  115.199997  114.550003  6734400.0  114.550003
2020-05-13  115.349998  113.730003  114.279999  113.919998  9312600.0  113.919998
2020-05-14  114.449997  111.250000  113.540001  113.809998  9310000.0  113.809998

[1351 rows x 6 columns]
Or could just use data and now wb,in your import.
>>> from pandas_datareader import data, wb
>>>
>>> data.DataReader('PG', data_source='yahoo', start='2015-1-1')
                  High         Low        Open       Close     Volume   Adj Close
Date
2015-01-02   91.000000   89.919998   90.839996   90.440002  7251400.0   76.279633
2015-01-05   91.000000   89.849998   90.230003   90.010002  8626100.0   75.916954
2015-01-06   90.559998   89.260002   90.309998   89.599998  7791200.0   75.571159
2015-01-07   90.370003   89.559998   89.940002   90.070000  5986600.0   75.967552
2015-01-08   91.230003   90.129997   90.480003   91.099998  6823300.0   76.836281
...                ...         ...         ...         ...        ...         ...
2020-05-08  116.300003  113.389999  113.519997  115.949997  9283100.0  115.949997
2020-05-11  116.010002  114.919998  115.750000  115.309998  6946300.0  115.309998
2020-05-12  115.900002  114.139999  115.199997  114.550003  6734400.0  114.550003
2020-05-13  115.349998  113.730003  114.279999  113.919998  9312600.0  113.919998
2020-05-14  114.449997  111.250000  113.540001  113.809998  9310000.0  113.809998

[1351 rows x 6 columns]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with to check an Input list data with a data read from an external source sacharyya 3 403 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  Likert survey data plot error Andrzej_Andrzej 6 1,399 Jul-16-2023, 10:11 PM
Last Post: deanhystad
  Pulling Specifics Words/Numbers from String bigpapa 2 752 May-01-2023, 07:22 PM
Last Post: bigpapa
  Having trouble installing scikit-learn via VSC and pulling my hair out pythonturtle 1 756 Feb-07-2023, 02:23 AM
Last Post: Larz60+
  (Python) Pulling data from UA Google Analytics with more than 100k rows into csv. Stockers 0 1,219 Dec-19-2022, 11:11 PM
Last Post: Stockers
  Read nested data from JSON - Getting an error marlonbown 5 1,358 Nov-23-2022, 03:51 PM
Last Post: snippsat
  Pulling username from Tuple pajd 21 3,349 Oct-07-2022, 01:33 PM
Last Post: pajd
  Write sql data or CSV Data into parquet file mg24 2 2,421 Sep-26-2022, 08:21 AM
Last Post: ibreeden
Heart Yahoo email "search and destroy"! Linh_lee 20 4,243 Aug-28-2022, 10:57 AM
Last Post: sandrahdes
  xml simple reader kucingkembar 2 1,053 Aug-19-2022, 08:51 PM
Last Post: kucingkembar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020