Giter Site home page Giter Site logo

Comments (7)

rhshadrach avatar rhshadrach commented on May 27, 2024 1

Thanks @melissawm. But this is odd - I don't know what :okwarning: would do to resolve the issue if you're not seeing a warning. I'd be hesitant to add such a line when we don't see the failing on the CI without understanding further.

from pandas.

rhshadrach avatar rhshadrach commented on May 27, 2024

The UserWarning for pd.to_datetime(pd.Series(["Jul 31, 2009", "Jan 10, 2010", None])) seems to be strange because no warning occurs when I directly run this code in ipython.

This suggests to me you are using two different pythons when you build docs vs when you run in ipython. When you build and install pandas, what python is used?

from pandas.

Huanghz2001 avatar Huanghz2001 commented on May 27, 2024

@rhshadrach
I directly run the commands python make.py and ipython in the same conda environment. I have checked that they use the same python.

$ which ipython
/home1/hhz/miniconda3/envs/pandas_main/bin/ipython
$ which python
/home1/hhz/miniconda3/envs/pandas_main/bin/python
$ cat /home1/hhz/miniconda3/envs/pandas_main/bin/ipython
#!/home1/hhz/miniconda3/envs/pandas_main/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(start_ipython())

from pandas.

rhshadrach avatar rhshadrach commented on May 27, 2024

Very odd. I would suggest to try recreating your environment, but from the commands above I believe you've already done that.

from pandas.

melissawm avatar melissawm commented on May 27, 2024

Hi all, I am getting the same issue. Adding :okwarning: to this block

.. ipython:: python
pd.to_datetime(pd.Series(["Jul 31, 2009", "Jan 10, 2010", None]))
pd.to_datetime(["2005/11/23", "2010/12/31"])

solves the issue for me. I'm happy to submit a PR if that's the acceptable solution. Cheers!

from pandas.

rhshadrach avatar rhshadrach commented on May 27, 2024

@melissawm - If you run this code on its own (outside building the docs), what's the warning you're seeing?

from pandas.

melissawm avatar melissawm commented on May 27, 2024

Here you go, no warnings:

(pandas-dev) ➜  ~ ipython 
Python 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.22.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pandas as pd
+ /home/melissa/micromamba/envs/pandas-dev/bin/ninja
[1/1] Generating write_version_file with a custom command

In [2]: pd.to_datetime(pd.Series(["Jul 31, 2009", "Jan 10, 2010", None])
   ...: )
Out[2]: 
0   2009-07-31
1   2010-01-10
2          NaT
dtype: datetime64[ns]

In [3]: pd.to_datetime(["2005/11/23", "2010/12/31"])
Out[3]: DatetimeIndex(['2005-11-23', '2010-12-31'], dtype='datetime64[ns]', freq=None)

In [4]: pd.__version__
Out[4]: '2.2.0.dev0+1627.g9cd5e5546c.dirty'

In [5]: 

from pandas.

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.