Git Product home page Git Product logo

utils_pandas_ts's Introduction

Project Status: Active - The project has reached a stable, usable state and is being actively developed.

utils_pandas_ts for knowing what are you dealing while working with a Pandas.Series object

Utility functions for pandas time series data.

Currently, pdts_utils.py code includes;

chunk_sizer function:

  • Takes a Pandas.Series() object, such as a column from a time series dataframe.
  • It calculates number of NaN elements and valid elements in a given column.
  • It also counts the number of continuous NaN or valid chunks in the series.
  • Returns the chunk list where it records all chunks consecutively with their sizes
  • [Optional] endtrim True removes the last chunk in the series and return it, in case the last of the series is NaN.

valid_chunk function:

  • Takes a Pandas.Series() object, such as a column from a time series dataframe.
  • Calculates number of valid elements in a given column
  • Provides the length of the longest valid chunk
  • Provides histogram of the valid chunk sizes
  • Returns the chunk list of the valid chunk sizes in their order

nan_chunk function:

  • This function mirrors valid_chunk function to the NaN chunks.

max_pickler function (added September 13,2023):

  • This uses valid_chunk() and nan_chunk functions together.
  • It returns the starting and ending locations of the longest continuous valid number chunk

utils_pandas_ts's People

Contributors

torna4o avatar

Watchers

 avatar

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.