question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NaT in date columns make histograme go crazy

See original GitHub issue

Hello,

I am referencing issue 111, which happens again in version 2.8.0

import pandas as pd
import pandas_profiling
import numpy as np


def test_issue_111():
    years = pd.Series(["{:02d}/01/{}".format(x, y) for x in range(1989, 2020) for y in range(1, 30)])

    df = pd.DataFrame(np.random.randint(0, len(years), size=(len(years), 4)), columns=list('ABCD'))
    df['E'] = pd.to_datetime(years)
    df['E'].iloc[10:100] = pd.NaT

    report = df.profile_report()
    report.to_file('test.html')

_From the post by @sbrugman in https://github.com/pandas-profiling/pandas-profiling/issues/111#issuecomment-497034063_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mbh86commented, Jul 16, 2020

@sbrugman, I tested it and it works, thank you.

0reactions
sbrugmancommented, Jul 15, 2020

The v2.9.0rc1 release is out, and should resolve this issue. Until this version is fully released, you can install it via pip in the following way:

pip install --pre -U pandas-profiling

It would be very helpful to know if the release candidate adequately solves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NaT in date columns make histograme go crazy #111 - GitHub
I noticed that when a date columns contains missing values NaT the histogram shows them at a date around 1670. That makes the...
Read more >
date column in python has more NAT values [duplicate]
I am learning Python for Data Science. I have dataset with date column having more NaT values. How to get it replaced or...
Read more >
pyspark.pandas.to_datetime - Apache Spark
Passing errors='coerce' will force an out-of-bounds date to NaT, in addition to forcing non-dates (or non-parseable dates) to NaT.
Read more >
Essential basic functionality — pandas 1.5.2 documentation
pandas objects ( Index , Series , DataFrame ) can be thought of as containers for arrays, which hold the actual data and...
Read more >
The pandas DataFrame Object - Cheat Sheet
Typically, the column index (df.columns) is a list of ... Get a DataFrame from data in a Python dictionary ... 2nd example returns...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found