Giter VIP home page Giter VIP logo

Comments (1)

fja05680 avatar fja05680 commented on July 25, 2024

I have implemented a less aggressive nan strategy that fixes the problem described in this issue. This approach gives more control and responsibility to the pinkfish user to solve problems with their timeseries, while also providing options to automatically fix problems.

(1) fetch_timeseries() no longer removes rows with nan values.
(2) select_tradeperiod() lets you specify the columns to check for nan values via check_fields argument. The default is ['close']. You can specify an empty list if you want.
(3) finalize_timeseries() has an argument that lets you specify whether to drop rows with nan values via dropna, default is False.
(4) The stock_market_calendar is no longer applied unless force_stock_market_calendar=True is set in select_tradeperiod().

A warning is issued if nan values are detected within finalize_timeseries(). A function was added find_nan_rows()' to help track down problematic timeseries. The above changes were also made for portfolio, except dropna` default is True in portfolio.finalize_timeseries().

With the default settings, the example above works as you expect.

"Yahoo data downloads from 1971 ... not good enough, but adequate for a quick test."
This is or was a problem on Windows platform only. You can see if it's been resolved by setting from_year=1900 in fetch_timeseries(). If it's no longer a problem, please let me know and I'll remove the check.

from pinkfish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.