yahoo-finance

Error: The truth value of a series is ambiguous. Python & Pandas

心已入冬 提交于 2019-12-02 20:56:07
问题 I'm trying to identify all the options contracts for MSFT and GOOG that have over 10,000 in volume for the day and to print out the name of the symbol.I am getting the error "The truth value of a series is ambiguous.Use a.empty, a.bool(), a.item(), a.any() or a.all()." The error is on line 13. Any help is greatly appreciated. from pandas_datareader.data import Options import pandas as pd from pandas import DataFrame import datetime tickers = ['GOOG','MSFT'] for i in tickers: option = Options

Update MySQL table with CSV data containing literal values in an unsupported format

给你一囗甜甜゛ 提交于 2019-12-02 18:56:32
问题 Someone recently deleted a question that I thought could be quite helpful to the community. I paraphrase: I am obtaining a CSV file from the Yahoo! Finance API, with which I then wish to update the following MySQL table: CREATE TABLE yahoo.static ( symbol VARCHAR(10) NOT NULL, exchange VARCHAR(200), name VARCHAR(300), capitalization DOUBLE, div_pay_date DATE, book_value DOUBLE, float_shares BIGINT UNSIGNED, PRIMARY KEY (symbol) ); The CSV file has the following format: "AAUKF","AAUKF","Other

stocks splitting api google or yahoo

本小妞迷上赌 提交于 2019-12-02 17:21:49
I am looking for a way to get stock splitting information. Using the yahoo stock API I can get all types of info on any symbol but I don't think I can get the split ratio or even whether it split. Does anyone know of a way of getting this info? This is how the quantmod R package does it. The split information is in the "Dividend Only" CSV: http://ichart.finance.yahoo.com/x?s=IBM&a=00&b=2&c=1962&d=04&e=25&f=2011&g=v&y=0&z=30000 来源: https://stackoverflow.com/questions/6119867/stocks-splitting-api-google-or-yahoo

Python - Pandas Dataframe - data not matching source

南笙酒味 提交于 2019-12-02 16:35:28
问题 I'm trying to use monthly stock data from yahoo to analyze patterns. For some reason, the monthly returns the program is spitting out in a dataframe for a particular stock (ATVI) do not match the returns from the actual yahoo site. I compared monthly returns for the 2015 period and included columns for average increases and decreases as well as the # of occurrences of each. Yahoo link: https://finance.yahoo.com/q/hp?s=ATVI&a=00&b=1&c=2015&d=11&e=31&f=2015&g=m My code: from datetime import

Python - Pandas Dataframe - data not matching source

前提是你 提交于 2019-12-02 10:49:20
I'm trying to use monthly stock data from yahoo to analyze patterns. For some reason, the monthly returns the program is spitting out in a dataframe for a particular stock (ATVI) do not match the returns from the actual yahoo site. I compared monthly returns for the 2015 period and included columns for average increases and decreases as well as the # of occurrences of each. Yahoo link: https://finance.yahoo.com/q/hp?s=ATVI&a=00&b=1&c=2015&d=11&e=31&f=2015&g=m My code: from datetime import datetime from pandas_datareader import data, wb import pandas_datareader.data as web import pandas as pd

Error: The truth value of a series is ambiguous. Python & Pandas

馋奶兔 提交于 2019-12-02 10:07:16
I'm trying to identify all the options contracts for MSFT and GOOG that have over 10,000 in volume for the day and to print out the name of the symbol.I am getting the error "The truth value of a series is ambiguous.Use a.empty, a.bool(), a.item(), a.any() or a.all()." The error is on line 13. Any help is greatly appreciated. from pandas_datareader.data import Options import pandas as pd from pandas import DataFrame import datetime tickers = ['GOOG','MSFT'] for i in tickers: option = Options(i,'yahoo') data = option.get_all_data() if data.Vol > 10000: print data.Symbol else: pass The problem

Scrape Yahoo Finance Income Statement with Python

耗尽温柔 提交于 2019-12-01 18:55:34
I'm trying to scrape data from income statements on Yahoo Finance using Python. Specifically, let's say I want the most recent figure of Net Income of Apple . The data is structured in a bunch of nested HTML-tables. I am using the requests module to access it and retrieve the HTML. I am using BeautifulSoup 4 to sift through the HTML-structure, but I can't figure out how to get the figure. Here is a screenshot of the analysis with Firefox. My code so far: from bs4 import BeautifulSoup import requests myurl = "https://finance.yahoo.com/q/is?s=AAPL&annual" html = requests.get(myurl).content soup

Saving multiple plots on a single pdf page using matplotlib

北城余情 提交于 2019-12-01 13:29:23
I'm trying to save the graphs of all 11 sectors from sectorlist to 1 pdf sheet. So far the code below gives me a graph on a separate sheet (11 pdf pages). The daily return functions is the data I'm plotting. There are 2 lines on each graph. with PdfPages('test.pdf') as pdf: n=0 for i in sectorlist: fig = plt.figure(figsize=(12,12)) n+=1 fig.add_subplot(4,3,n) (daily_return[i]*100).plot(linewidth=3) (daily_return['^OEX']*100).plot() ax = plt.gca() ax.set_ylim(0, 100) plt.legend() plt.ylabel('Excess movement (%)') plt.xticks(rotation='45') pdf.savefig(fig) plt.show() Not sure if your indentation

How do I get started with oauth for YQL for historical stock data?

天大地大妈咪最大 提交于 2019-12-01 11:06:00
问题 in my search for a market data feed, I've been led to YQL for yahoo finance. It looks great, and very simple for the public use/ queries, but the daily limit for the public version is too small for my needs.. I got my yahoo ID to get started with oauth, but I can't find any good examples pertaining to what I'm trying to do... I'd like to "sign in" with my desktop app in C#, and proceed to download data of interest. How do I use the oath dimension? My background as a point of reference is

read.csv(“http://ichart.finance.yahoo.com/table.csv?s=SPY”) Not Working

匆匆过客 提交于 2019-12-01 10:58:26
I have been using the following command for a long time without problem: spy <- read.csv("http://ichart.finance.yahoo.com/table.csv?s=SPY") But in the past few days it started to throw the following error: Warning messages: 1: In file(file, "rt") : "internal" method cannot handle https redirection to: ' https://ichart.finance.yahoo.com/table.csv?s=SPY ' 2: In file(file, "rt") : "internal" method failed, so trying "libcurl" I've updated my RStudio, R and all packages to the most up-to-date versions as of today. Could someone help me resolve this issue? Thanks in advance! The fix is right there