Python for Finance: getting stock data with pandas datareader

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 79

  • @ruhipanchal7188
    @ruhipanchal7188 Год назад +80

    if you are facing an error: string indices must be integers
    I found a solution somewhere
    0) pip install yfinance
    1) import import yfinance as yf
    2) yf.pdr_override()
    3) df = pdr.get_data_yahoo(stocks, start, end) and run it

    • @sohomroy4702
      @sohomroy4702 Год назад +3

      thanks mate, saved me from going crazy

    • @taqipro4514
      @taqipro4514 Год назад +3

      thank u vey much , I need to submit my project tommorow!

    • @raavitejaswi1194
      @raavitejaswi1194 Год назад +1

      Thankyou so much, struck with that part for last 1hr, thanks a lot.

    • @cityroving
      @cityroving Год назад +1

      thanks very much helpful

    • @kzyanisara9357
      @kzyanisara9357 Год назад +1

      thank you

  • @aron5377
    @aron5377 Год назад +7

    I feel like I learned more useful stuff than in some of my actual uni courses. Just subscribed, looking forward to digging through your archive.

    • @sentriple5120
      @sentriple5120 Год назад

      have you used any of his formulas for trading?

  • @yashsaraswat6633
    @yashsaraswat6633 Год назад

    Best video on yahoo finance data fetching

  • @jenniferkirschnickduffy2098
    @jenniferkirschnickduffy2098 5 месяцев назад +3

    This tutorial is so well done. Thank you thank you thank you!!

  • @pkavenger9990
    @pkavenger9990 2 года назад +4

    Great video, a little bit of suggestion for videos that you should make your live cam smaller in corner and zoom a little on the code that you are typing so people can see it clearly.

  • @SD-gw5vm
    @SD-gw5vm Год назад +1

    Niccceeee. This is exactly what I have been looking for. Thank you

  • @SM-fb4qb
    @SM-fb4qb Год назад +5

    doesn't work
    TypeError: string indices must be integers

  • @John-xi2im
    @John-xi2im 7 месяцев назад +1

    very well explained tutorial , thanks a lot @QuantPy !!

  • @roncarr5505
    @roncarr5505 3 года назад +6

    Hi Johnathon,
    A few questions:
    (1) when will you have the video available idincating how to import all ASX200 stocks,
    (2) How do we convert the Jupyter script to just a python script,
    (3) What is the maximum numbers of stocks you can request information on via a script

    • @QuantPy
      @QuantPy  3 года назад +2

      Hi Ron, thanks for your question.
      1) there are no real tricks to this. Simply using a list of all ASX200 stocks will do the job. I recommend getting this list from ASX website.
      2) copy the code from my website, link in description straight into python script editor. Idle/visual studio code whatever it may be.
      Python files end in .py
      3) I do not know, this a more likely a restriction on the yahoo api bandwidth.
      Hopefully that helps

    • @junepan1914
      @junepan1914 2 года назад

      @@QuantPy hi Johnathon, the link from your website has expired. could you please send me the code for vs code? thanks a lot!

  • @nickdechip177
    @nickdechip177 3 года назад +5

    amazing video, this is great stuff please keep it coming. Thank you very much for giving up your time to do this.

  • @tamoorkhan3262
    @tamoorkhan3262 3 года назад +5

    Great stuff. Didn't know it's that easy using pandas. Thanks. (Y)

  • @Dongnanjie
    @Dongnanjie Год назад

    Loved it. Thank you sir!

  • @kaiwang2924
    @kaiwang2924 Год назад

    Plotly NO.1

  • @farshadfarzan6425
    @farshadfarzan6425 Год назад +1

    The link to the full code doesn't work

  • @ih9346
    @ih9346 2 года назад +1

    good stuff mate, worked like a (py) charm!

  • @krishnadfs
    @krishnadfs 2 года назад

    Very illustrative video

  • @xiupingli2892
    @xiupingli2892 6 месяцев назад +2

    error: module is not found for pandas_datareader

  • @yildirimicen766
    @yildirimicen766 2 года назад

    really great stuff, thx.
    a sidenote:
    please use s higher fontsize to simplify following if watching on a mobile phone... It is not always the Laptop, often it is browsing through sophisticated topics but with mobile phone, getting an idea of what is possible but....... standard fonts on the Display and too small to follow.
    Please use a reasonable fontsize... maybe 2 or 3 points higher, there is enough space for it to do so.... thx. :)

  • @krullskull9093
    @krullskull9093 3 года назад +1

    Thank you for the informative video.

  • @neronjp9909
    @neronjp9909 Год назад

    Amazing, thx so much, support as always !

  • @aravinthmegnath3569
    @aravinthmegnath3569 Год назад +1

    How to resolve the following error?
    TypeError: string indices must be integers
    code: df = web.get_data_yahoo(stocks,start,end)

    • @sklanman
      @sklanman Год назад

      I'm getting the same error.
      File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas_datareader\yahoo\daily.py:153, in YahooDailyReader._read_one_data(self, url, params)
      151 try:
      152 j = json.loads(re.search(ptrn, resp.text, re.DOTALL).group(1))
      --> 153 data = j["context"]["dispatcher"]["stores"]["HistoricalPriceStore"]
      154 except KeyError:
      155 msg = "No data fetched for symbol {} using {}"
      TypeError: string indices must be integers

  • @aarondelarosa3146
    @aarondelarosa3146 Год назад

    Actually I'm using Jupiter Lab in Anaconda. Are you using Visual Studio Code? How can you run python in VSC? What about Google Colab? what platform is better?

  • @nyxnix2479
    @nyxnix2479 4 месяца назад

    Thanks for this tutorial.
    Juste Data_source="Yahoo" doesn't work (NotImplementedError

  • @keremkostak6522
    @keremkostak6522 Год назад +1

    df = pdr.get_data_yahoo(stocks,start,end)
    df.head()
    TypeError: string indices must be integers

    • @ENRICHEDK
      @ENRICHEDK Год назад +2

      You need to
      Step 1) Pip install yfinance
      Step 2) at the top section. import yfinace as yf
      Step 3) above the df =, do, yf.pdr_override()

    • @vineethvijayan9695
      @vineethvijayan9695 4 месяца назад

      @@ENRICHEDK no longer woks get: AttributeError: module 'yfinance' has no attribute 'pdr_override'

  • @dvtoro
    @dvtoro 3 месяца назад

    Hello, I just stuck at the beginning, I got a bug with the pandas_datareader

  • @harrye290
    @harrye290 7 месяцев назад

    im on mac and im not really sure how to get jupyter lab working i have pandas and pandas-datareader downloaded in python but it is not working

  • @Plusminusco21
    @Plusminusco21 Год назад +2

    code is not accessbie

  • @mioszzalewski3298
    @mioszzalewski3298 12 дней назад

    How to download ALL US stocks from Yahoo Finance? Does anyone has updated list of all tockesrs?

  • @NamanSoni16
    @NamanSoni16 4 месяца назад

    When I'm doing Close.plot() with plotly, its giving a "performance warning" and saying that the DataFrame is highly fragmented. Anyone know how to fix this error?

  • @SD-gw5vm
    @SD-gw5vm Год назад

    Any chance of doing this tutorial in yFinance?

  • @sklanman
    @sklanman Год назад +1

    after either command to fill the dataframe, an exception occurs:
    File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas_datareader\yahoo\daily.py:153, in YahooDailyReader._read_one_data(self, url, params)
    151 try:
    152 j = json.loads(re.search(ptrn, resp.text, re.DOTALL).group(1))
    --> 153 data = j["context"]["dispatcher"]["stores"]["HistoricalPriceStore"]
    154 except KeyError:
    155 msg = "No data fetched for symbol {} using {}"
    TypeError: string indices must be integers

    • @xiongsheng1997
      @xiongsheng1997 Год назад +1

      Please do the following two lines:
      import yfinance as yf
      yf.pdr.override()

    • @arrogantmj
      @arrogantmj Год назад

      It works! Thank you!

  • @anthonychung8112
    @anthonychung8112 Год назад

    i typed in the data reader command same as the episode , but its seems not working . Anything with the yahoo pdr.DatarReader ?

    • @anthonychung8112
      @anthonychung8112 Год назад

      1 df=pdr.DataReader(stocks,'yahoo',start,end)
      2 df=pdr.get_data_yahoo(stocks,start,end)

  • @SanjibKC
    @SanjibKC 2 года назад

    Sir can you help me sending that python cose !!
    and how can fetch data from nepali stock market?
    NEPSE

  • @prioto
    @prioto 2 года назад

    amazing stuff thank you

  • @SanjibKC
    @SanjibKC 2 года назад

    same code doesnt fetch data from me.. why?

  • @potun3008
    @potun3008 3 года назад +1

    How to Use DataReader to read the names of every stock on the market.
    plssss

    • @QuantPy
      @QuantPy  3 года назад

      Hi, yes I can make a video on this. But will limit to a particular index ASX200.

  • @neronjp9909
    @neronjp9909 Год назад

    How to get "Income Statement" fr Yahoo ?thx

  • @lornemalvoo
    @lornemalvoo 3 года назад

    clear, thx sir.

  • @TheIntizar
    @TheIntizar Год назад

    in my jupyter code is not working
    string indices must be integers

    • @TheIntizar
      @TheIntizar Год назад

      anybody help

    • @sefayay1249
      @sefayay1249 Год назад

      i am getting the same problem. TypeError: string indices must be integers

    • @TheIntizar
      @TheIntizar Год назад

      @@sefayay1249 my issue is resolve use yfinance library

    • @mannynavarro5803
      @mannynavarro5803 Год назад

      Would you mind explaining what code you wrote to bring in the data from yfinance? I've installed yfinance but it still doesn't seem to be working for the example in the video.

  • @SOng-fs6es
    @SOng-fs6es Год назад

    btw the link to the code is not working idk y

  • @danielloza4710
    @danielloza4710 2 года назад

    RemoteDataError: Unable to read URL) does anyone know how to fix that ?

  • @JeffBarron1
    @JeffBarron1 2 года назад

    this seems to have stopped working? does yahoo need a key or something? google doesnt work either

    • @QuantPy
      @QuantPy  2 года назад +1

      Try pip updating the package. Check other comments

    • @For_Win_time
      @For_Win_time Год назад

      ​@@QuantPy how can I take out the data of particular time range ..lets say just 2 hours after market open for previous 1 year of any stock or indices .
      The goal is to find out the price range with 1st 2 hrs of last 1 year for any financial product

  • @iannyingi8527
    @iannyingi8527 2 года назад +1

    Does anyone know how to fix this error
    ValueError: Index contains duplicate entries, cannot reshape