I am trying to download data from Yahoo Finance using pandasb but nothing happens?
<pre><code>import pandas_datareader.data as web
import datetime
start = datetime.datetime(2010, 1, 1)

end = datetime.datetime(2013, 1, 27)

f = web.DataReader("ugaz", 'yahoo', start, end)

f.ix['2010-01-04']
</code></pre>

<p>The above is the code I am currently trying to use to get data from Yahoo Finance. when I run the code I get this in the python shell 3.5.2 window</p>

<pre><code>==================== RESTART: C:/Users/Zac/Desktop/ll.py ====================
</code></pre>

<p>That's all that I get. I am using python 3.5 on windows 10 </p>

<p>There are so many ways to download financial data, or any kind of data, from the web.  The script below downloads stock prices and saves everything to a CSV file.</p>

<pre><code>import urllib2

listOfStocks = ["AAPL", "MSFT", "GOOG", "FB", "AMZN"]

urls = []

for company in listOfStocks:
    urls.append('http://real-chart.finance.yahoo.com/table.csv?s=' + company + '&amp;d=6&amp;e=28&amp;f=2015&amp;g=m&amp;a=11&amp;b=12&amp;c=1980&amp;ignore=.csv')

Output_File = open('C:/Users/your_path/Historical_Prices.csv','w')

New_Format_Data = ''

for counter in range(0, len(urls)):

    Original_Data = urllib2.urlopen(urls[counter]).read()

    if counter == 0:
        New_Format_Data = "Company," + urllib2.urlopen(urls[counter]).readline()

    rows = Original_Data.splitlines(1)

    for row in range(1, len(rows)):

        New_Format_Data = New_Format_Data + listOfStocks[counter] + ',' + rows[row]

Output_File.write(New_Format_Data)
Output_File.close()
</code></pre>

<p>The script below will download multiple stock tickers into one folder.</p>

<pre><code>import urllib
import re
import json

symbolslist = open("C:/Users/rshuell001/Desktop/symbols/tickers.txt").read()
symbolslist = symbolslist.split("\n")

for symbol in symbolslist:
    myfile = open("C:/Users/your_path/Desktop/symbols/" +symbol +".txt", "w+")
    myfile.close()

    htmltext = urllib.urlopen("http://www.bloomberg.com/markets/chart/data/1D/"+ symbol+ ":US")
    data = json.load(htmltext)
    datapoints = data["data_values"]

    myfile = open("C:/Users/rshuell001/Desktop/symbols/" +symbol +".txt", "a")
    for point in datapoints:
        myfile.write(str(symbol+","+str(point[0])+","+str(point[1])+"\n"))
    myfile.close()
</code></pre>

<p>Finally...this will download prices for multiple stock tickers...</p>

<pre><code>import urllib
import re

symbolfile = open("C:/Users/your_path/Desktop/symbols/amex.txt")
symbollist = symbolfile.read()

newsymbolslist = symbollist.split("\n")

i=0
while i&lt;len(newsymbolslist):
    url = "http://finance.yahoo.com/q?s=" + newsymbolslist[i] + "&amp;ql=1"
    htmlfile = urllib.urlopen(url)
    htmltext = htmlfile.read()
    regex = '&lt;span id="yfs_l84_' + newsymbolslist[i] + '"&gt;(.+?)&lt;/span&gt;'
    pattern = re.compile(regex)
    price = re.findall(pattern,htmltext)
    print "the price of ", newsymbolslist[i] , "is", price[0]
    i+=1

# Make sure you place the 'amex.txt' file in 'C:\Python27\'
</code></pre>

<p>I wrote a book about these kinds of things, and lots of other stuff.  You can find it using the URL below.</p>

<p><a href="http://rads.stackoverflow.com/amzn/click/B01DJJKVZC" rel="nofollow">https://www.amazon.com/Automating-Business-Processes-Reducing-Increasing-ebook/dp/B01DJJKVZC/ref=sr_1_1</a>?</p>

python pandas yahoo-finance