Python Forum
Yahoo_fin, Pandas: how to convert data table structure in csv file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yahoo_fin, Pandas: how to convert data table structure in csv file
#13
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.

Quote:why not learn how to read from a file, e.g. csv/text file with all tickers. instead of constructing a big literal.
And, please, make an effort first. You can read it in number of ways, incl. pandas obviously
That is not an advice.

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.
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?
That is also not an 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.
Reply


Messages In This Thread
RE: Yahoo_fin, Pandas: how to convert data table structure in csv file - by detlefschmitt - Feb-15-2021, 08:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 1,052 Feb-29-2024, 12:30 AM
Last Post: Winfried
  Better python library to create ER Diagram by using pandas data frames as tables klllmmm 0 1,196 Oct-19-2023, 01:01 PM
Last Post: klllmmm
  Trying to get counts/sum/percentages from pandas similar to pivot table cubangt 6 1,482 Oct-06-2023, 04:32 PM
Last Post: cubangt
Thumbs Up Convert word into pdf and copy table to outlook body in a prescribed format email2kmahe 1 791 Sep-22-2023, 02:33 PM
Last Post: carecavoador
  Using pyodbc&pandas to load a Table data to df tester_V 3 856 Sep-09-2023, 08:55 PM
Last Post: tester_V
  Hard disk structure like a file selection dialog malonn 2 813 Aug-09-2023, 09:14 PM
Last Post: malonn
  Convert File to Data URL michaelnicol 3 1,237 Jul-08-2023, 11:35 AM
Last Post: DeaD_EyE
  Python Script to convert Json to CSV file chvsnarayana 8 2,595 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  python pandas sql table with header mg24 3 2,015 Dec-08-2022, 08:31 PM
Last Post: Larz60+
  openpyxl convert data to float jacklee26 13 6,170 Nov-19-2022, 11:59 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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