Giter VIP home page Giter VIP logo

Comments (3)

Axemen avatar Axemen commented on July 24, 2024 1

Hello @jeffhandl, @wenouyang

I was able to reproduce the issue on windows and it turns out that it's a known issue when attempting to convert a datetime to a negative timestamp (before 1970).

Here is a stack overflow post regarding the error on windows
https://stackoverflow.com/questions/56931738/python-crash-on-windows-with-a-datetime-close-to-the-epoch?noredirect=1#comment100413591_56931738

and a link to the issue in python itself
https://bugs.python.org/issue37527

This problem can be currently be sidestepped on windows by not attempting the unix timestamp conversion and using other methods instead. Other methods are outlined inside of the kats_101_basics.ipynb in the surrounding cells.

Some of the alternatives are:

# Passing the entire dataframe to the TimeSeriesData Object
air_passengers_ts = TimeSeriesData(air_passengers_df)

# Passing the series of string dates
air_passengers_ts_from_series = TimeSeriesData(time=air_passengers_df.time, value=air_passengers_df.value)

# Passing in a series of python datetime objects in a series 
from dateutil import parser

air_passengers_ts_datetime = air_passengers_df.time.apply(
    lambda x: parser.parse(x)
)

ts_from_unixtime = TimeSeriesData(
        time=air_passengers_ts_datetime , 
        value=air_passengers_df.value, 
        use_unix_time=True, 
        unix_time_units="s"
)

from kats.

jeffhandl avatar jeffhandl commented on July 24, 2024

Hi @wenouyang, thank you for submitting this issue. I'm not able to reproduce it and am wondering if it's related to the version of Pandas you are using and this known issue. Does this error persist after upgrading Pandas?

from kats.

wenouyang avatar wenouyang commented on July 24, 2024

@Axemen , @jeffhandl , thank you very much for your response. The issue has been solved as you suggested.

from kats.

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.