Python for Spreadsheets and CSV File manipulation – Part 3 using other rows



This is the 3rd video in the CSV/Spreadsheet manipulation with programming mini-series. This video teaches you how to do horizontal manipulation alongside vertical. This means you can use data from other rows as well in your calculations.

The main reason why you would want to use a programming language like python to help you with your spreadsheets is it can actually become easier to use python than a typical spreadsheet program. This happens when you want to use extensive formulas or even apply a little bit of coding logic to the spreadsheet’s cells.

Sentdex.com
Facebook.com/sentdex
Twitter.com/sentdex

Nguồn: https://benjaminjcohen.com/

Xem thêm bài viết khác: https://benjaminjcohen.com/cong-nghe/

14 Comments

  1. Thank you for these videos. I was hoping excel would be covered.

  2. what IDE are you using? Is it free?

  3. Hi can anyone help me understand how we get the first value 5225.. Thanks

  4. Cool….. 🙂 I needed something like this for a project….

  5. How can I plot a continuos logfile in real time? Thanks for your channel

  6. Nice series of videos!  Question; I have a csv file, and it has 3 columns that each contain comma separated words (my csv file uses double quotes around the contents of each column because of that). I'd like to split the contents of those columns out so each word is put into it's own row, and append the other columns, to make a new "table" that will be imported into SQL.  How might I do that?  Thanks!

  7. I'd like to know how to take data from multiple CSV files and put it all into one CSV file.  Specifically, the stock files that I have from the stock puller in your series 'Python Charting Stocks/Forex for Technical Analysis .  https://www.youtube.com/watch?v=u6Xd3kRHhJI&list=PLQVvvaa0QuDcR-u9O8LyLR7URiKuW-XZq&index=1  I would like to be able to be able to loop through them all, I have a lot of them.

    I want to make a new CSV file called 'ToExcel.txt'(I plan on importing it to excel), it would have the dates in first column and then closing price from every stock in subsequent columns.  The first column would be headed 'Dates' and subsequent columns would be headed the name of the stock.  i.e.:

    Date,          GOOG,TSLA,
    2014/05/06,67.89,  45.76,
    2014/05/07,68.48,  43.92,
    2014/05/08,65.23,  47.87,

    I don't have data for every day on all the stocks, for example I tried pulling 3 year data, which should be daily going back 3 years, but GOOG only goes back to near the beginning of 2014.  Because of the missing dates on some of the stocks, I need a way for the stock price to be written in the row of 'ToExcel' that has the same date as the date in the 'stock' file, not just writing at the beginning of the column. For example if GOOG is missing data from 2014/05/06 and TSLA is missing data from 2014/05/07:

    Date,          GOOG,TSLA,
    2014/05/06,         '', 45.76,
    2014/05/07,68.48,         '',
    2014/05/08,65.23,  47.87,

    The blank cells would be written as empty strings.

    If you could help me with this I’d greatly appreciate it Harrison, and thank you for all your videos!

  8. could you do a vid on how to deal with headers, or point me to a resource that'll explain this? for instance, i'm reading a file into python and want to assign some columns to variables, but the file i'm reading contains headers.

  9. Cool tutorial. I'm trying to learn python to exactly what you're doing; perform data manipulation on forex pairs to get other meta data (excel works fine but I think as I start to get more advanced the computing speed of Python and ability to save scripts separately will help). 

    My question is in the example of adding the previous number to the current(4:12), where is the 5225 number coming from if 4565 is the first number and there's no number before it?

  10. Sometimes, if your computer is quick enough, you can trip up the operation, even when it's an append…like it tries to do simultaneous appends or something…EVEN though you can do this if you thread. I've tried various methods and it just seems to not trip when I have the open and close in there.

  11. Good video, but question. why is the file opened and closed inside the for loop? Thanks for the video though, I will use it in manipulating my dirlists of music data.
    bob

  12. yep, Finam. It's a Russian site, offering tick data from BATS on the top 40 stocks by market cap I believe. It also includes a bunch from other markets too.

  13. 'Awesome' thank you very much. it will help

    by the way, in some video, you mentioned a good source of free intraday (maybe tick) data
    the best I have is either from Meta4 one minute charts (exportable to csv…)

    thank you very much.

Leave a Reply

Your email address will not be published. Required fields are marked *