Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How does one combine 2 data sets ?
Post: RE: How does one combine 2 data sets ?

Thanks for the hint. I was able to solve the problem using pandas join function. import pandas as pd from yahoo_fin import stock_info as si ti = pd.read_csv('/Users/detlefschmitt/Desktop/TickerList....
detlefschmitt General Coding Help 2 1,701 Sep-03-2021, 03:38 AM
    Thread: How does one combine 2 data sets ?
Post: How does one combine 2 data sets ?

In the below script I am creating 2 datasets (stats1, stats2). One in each for loop. Now I want to combine the two data sets. That is, adding the columns from stats2 after the last column in stats1. I...
detlefschmitt General Coding Help 2 1,701 Sep-02-2021, 11:31 AM
    Thread: Exporting Stock Fundamental Data to a CSV file with yahoo_fin
Post: RE: Exporting Stock Fundamental Data to a CSV file...

try this. The program in this example imports the csv file column with the header name "Ticker". How to create a csv file containing e.g. the ticker symbols from the NASDAQ can be found in this post. ...
detlefschmitt General Coding Help 2 4,738 Mar-02-2021, 02:07 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

Help vampire. hahahahaha. I think it is exaggerated to call me that after having asked two questions on this forum. I didn't asked for help about importing csv and incorpotaring csv column data into t...
detlefschmitt General Coding Help 14 7,801 Feb-15-2021, 12:58 PM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

I don't blame you for having to spend a couple hours figuring out a 2-line code. The problem was not reading the csv. That info is provided as the first line of code on any website explaining how to ...
detlefschmitt General Coding Help 14 7,801 Feb-15-2021, 08:17 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

buran, sorry about that. I will refrain from removing posted content in the future. Thank you for the advice about df.pivot. That was good advice. Also thank you for keeping my posts containing privat...
detlefschmitt General Coding Help 14 7,801 Feb-15-2021, 06:05 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

This is the same code as posted above. import pandas as pd from yahoo_fin import stock_info as si import glob ti = pd.read_csv('TickerList.csv') ti2 = ti["Ticker"].tolist() stock_list = ti2 stats ...
detlefschmitt General Coding Help 14 7,801 Feb-14-2021, 05:38 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

removed due to too personal
detlefschmitt General Coding Help 14 7,801 Feb-13-2021, 08:54 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

As alternative to reading the csv with python one can use an Excel VBA to convert an Excel column containing ticker symbols to a string that can then be pasted into the python code. The Excel VBA code...
detlefschmitt General Coding Help 14 7,801 Feb-13-2021, 08:04 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

To make the program more useful I added a few functions. I added importing ticker symbols from a csv file, deleting unwanted columns, renaming columns and changing the columns order. The program in th...
detlefschmitt General Coding Help 14 7,801 Feb-13-2021, 07:51 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: RE: Yahoo_fin, Pandas: how to convert data table s...

yes, that works! Thanks. I added the pivot line to my script. The question asked in this post is solved. import pandas as pd from yahoo_fin import stock_info as si stock_list = "AAPL", "MSFT" stats...
detlefschmitt General Coding Help 14 7,801 Feb-12-2021, 11:47 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

Learned something new. Thank you!
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 07:46 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

I now also figured out how to combine two data sets. See below script. With that my questions regarding exporting stock ticker symbols and combining data sets are answered. This post can be marked as...
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 06:56 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

The below yahoo_fin script will export 2 ticker lists to 2 csv files. Question: how do I need to script so that the data is combined and exported to 1 csv file? import pandas as pd from yahoo_fin im...
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 06:25 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

I found the solution. The below yahoo_fin script will export all ticker symbols in the NASDAQ to a csv file. import pandas as pd from yahoo_fin import stock_info as si data = si.tickers_nasdaq() ...
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 06:11 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

Thanks for your information. I had a look at it. Mmm. Considering that my skills in python are very limited it is easier for me to stick with the ticker info provided on the NASDAQ website (ftp://ftp....
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 04:58 AM
    Thread: Yahoo_fin, Pandas: how to convert data table structure in csv file
Post: Yahoo_fin, Pandas: how to convert data table struc...

The below Yahoo_fin script exports 59 stock stats for each ticker to csv. The program is working fine. import pandas as pd from yahoo_fin import stock_info as si import glob stock_list = "MSFT", "...
detlefschmitt General Coding Help 14 7,801 Feb-12-2021, 02:42 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: RE: Yahoo_fin question: how does one export all s...

Thanks for the reply. I ran your program and understand the output. That is not what I was asking for. In the Yahoo_fin script I posted above the script line below imports stock_info. The subsequent ...
detlefschmitt General Coding Help 9 8,785 Feb-12-2021, 01:20 AM
    Thread: Yahoo_fin question: how does one export all stock tickers to a csv file
Post: Yahoo_fin question: how does one export all stock...

I noticed that the yahoo_fin script below from DustinKlent returns an error if a stock ticker is in the stock_list that is not in the yahoo_fin stock_info. To avoid error messages I would like to comp...
detlefschmitt General Coding Help 9 8,785 Feb-11-2021, 11:24 AM
    Thread: outdated post
Post: RE: Exporting Stock Fundamental Data to a CSV file...

outdated post
detlefschmitt General Coding Help 3 2,240 Feb-11-2021, 04:29 AM

User Panel Messages

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