Feb-15-2021, 08:17 AM
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 import a csv. You must be greedy for advice credit if you want to claim that as advice.
The problem was realizing that I need to convert the column to a list. That's what took time. Once I saw that on a website I realized immediately that this is the solution. With some trial and errors I finally came up with the very simple code. If you would have told me that after csv import the ticker column needs to be converted to a list, I would have needed only a fraction of the time. And that would have been a good advice.
I am not a bioinformatics person nor an IT guy. At work I never had to deal with DBs that would require the use of Power Query or VBA/ADODB to transfer data to Excel. The only time I used Power Query was to obtain financial statistics data from Yahoo Finance for personal reasons. So, I really don't have much experience with the input and output of data between DBs and Excel. Hence it took time to realize that I need to convert the column to a list. One can have a lot of experience with Excel VBA in one area and not know much in another. On top my knowledge in python is essentially zero.
The problem was not reading the csv. That info is provided as the first line of code on any website explaining how to import a csv. You must be greedy for advice credit if you want to claim that as advice.
The problem was realizing that I need to convert the column to a list. That's what took time. Once I saw that on a website I realized immediately that this is the solution. With some trial and errors I finally came up with the very simple code. If you would have told me that after csv import the ticker column needs to be converted to a list, I would have needed only a fraction of the time. And that would have been a good advice.
Quote:why not learn how to read from a file, e.g. csv/text file with all tickers. instead of constructing a big literal.That is not an advice.
And, please, make an effort first. You can read it in number of ways, incl. pandas obviously
Quote:I've been working with VBA/Office automation for years. Almost never looked back after I started with python. And you already know how to read data from a file into pandas dataframe and loop over it - what's the problem to read a list of tickers from cav or excel? Basically there is no learning here.That is also not an advice.
On a broader scale - isn't it better to store data in a DB and then connect from Excel, either with Power Query or VBA/ADODB if you prefer to manipulate your data in Excel?
I am not a bioinformatics person nor an IT guy. At work I never had to deal with DBs that would require the use of Power Query or VBA/ADODB to transfer data to Excel. The only time I used Power Query was to obtain financial statistics data from Yahoo Finance for personal reasons. So, I really don't have much experience with the input and output of data between DBs and Excel. Hence it took time to realize that I need to convert the column to a list. One can have a lot of experience with Excel VBA in one area and not know much in another. On top my knowledge in python is essentially zero.