pandas: powerful Python data analysis toolkit - 0.24.0accepts fill_value as an argument, allowing the user to specify a value which will be used instead of NA/NaT in the empty periods. (GH15486) • to_datetime() now supports the %Z and %z directive when passed into mode() and DataFrame.mode() now support the dropna parameter which can be used to specify whether NaN/NaT values should be considered (GH17534) • DataFrame.to_csv() and Series.to_csv() now support the compression a DataFrame column with timedelta64[ns] dtype will now raise a TypeError instead of returning all-NaT. This is for compatibility with TimedeltaIndex and Series behavior (GH22163) In [85]: df = pd.DataFrame([pd0 码力 | 2973 页 | 9.90 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.0.0missing data: np.nan is used for this for float data, np.nan or None for object-dtype data and pd.NaT for datetime-like data. The goal of pd.NA is to provide a “missing” indicator that can be used consistently 1.9.2 Datetimelike • Bug in Series.__setitem__() incorrectly casting np.timedelta64("NaT") to np. datetime64("NaT") when inserting into a Series with datetime64 dtype (GH27311) • Bug in Series.dt() property incorrectly lead to raising ValueError (GH28299) • Bug in core.groupby.SeriesGroupBy.nunique() where NaT values were interfering with the count of unique values (GH27951) • Bug in Timestamp subtraction when0 码力 | 3015 页 | 10.78 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 0.25.0behavior: In [1]: pd.MultiIndex(levels=[[np.nan, None, pd.NaT, 128, 2]], ...: codes=[[0, -1, 1, 2, 3, 4]]) ...: Out[1]: MultiIndex(levels=[[nan, None, NaT, 128, 2]], codes=[[0, -1, 1, 2, 3, 4]]) In [2]: pd MultiIndex(levels=[[1, 2]], codes=[[0, -2]]) New behavior: In [18]: pd.MultiIndex(levels=[[np.nan, None, pd.NaT, 128, 2]], ....: codes=[[0, -1, 1, 2, 3, 4]]) ....: (continues on next page) 1.2. Backwards incompatible cache=True, with arg including at least two different elements from the set {None, numpy.nan, pandas.NaT} (GH22305) • Bug in DataFrame and Series where timezone aware data with dtype='datetime64[ns] was0 码力 | 2827 页 | 9.62 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 0.25.1behavior: In [1]: pd.MultiIndex(levels=[[np.nan, None, pd.NaT, 128, 2]], ...: codes=[[0, -1, 1, 2, 3, 4]]) ...: Out[1]: MultiIndex(levels=[[nan, None, NaT, 128, 2]], codes=[[0, -1, 1, 2, 3, 4]]) In [2]: pd MultiIndex(levels=[[1, 2]], codes=[[0, -2]]) New behavior: In [18]: pd.MultiIndex(levels=[[np.nan, None, pd.NaT, 128, 2]], ....: codes=[[0, -1, 1, 2, 3, 4]]) ....: (continues on next page) 1.2. Backwards incompatible cache=True, with arg including at least two different elements from the set {None, numpy.nan, pandas.NaT} (GH22305) • Bug in DataFrame and Series where timezone aware data with dtype='datetime64[ns] was0 码力 | 2833 页 | 9.65 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.4In [178]: mdf.agg(["min", "sum"]) Out[178]: A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT Custom describe With .agg() it is possible to easily create a custom describe function, similar to if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). This might be useful if you are reading in data datetime.datetime(2016, 3, 2)] In [398]: pd.to_datetime(m, errors="coerce") Out[398]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [399]: m = ["apple", 2, 3] In [400]: pd.to_numeric(m0 码力 | 3605 页 | 14.68 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.2In [178]: mdf.agg(["min", "sum"]) Out[178]: A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT 2.3. Essential basic functionality 219 pandas: powerful Python data analysis toolkit, Release 1.3 if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). This might be useful if you are reading in data datetime.datetime(2016, 3, 2)] In [398]: pd.to_datetime(m, errors="coerce") Out[398]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [399]: m = ["apple", 2, 3] In [400]: pd.to_numeric(m0 码力 | 3509 页 | 14.01 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.3.3In [178]: mdf.agg(["min", "sum"]) Out[178]: A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT Custom describe With .agg() it is possible to easily create a custom describe function, similar to if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). This might be useful if you are reading in data datetime.datetime(2016, 3, 2)] In [398]: pd.to_datetime(m, errors="coerce") Out[398]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [399]: m = ["apple", 2, 3] In [400]: pd.to_numeric(m0 码力 | 3603 页 | 14.65 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.4.4In [178]: mdf.agg(["min", "sum"]) Out[178]: A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT Custom describe With .agg() it is possible to easily create a custom describe function, similar to if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). This might be 266 Chapter 2. User Guide pandas: datetime.datetime(2016, 3, 2)] In [398]: pd.to_datetime(m, errors="coerce") Out[398]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [399]: m = ["apple", 2, 3] In [400]: pd.to_numeric(m0 码力 | 3743 页 | 15.26 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.1.1Release 1.1.1 (continued from previous page) A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT Custom describe With .agg() it is possible to easily create a custom describe function, similar to if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). 2.3. Essential basic functionality 223 pandas: datetime.datetime(2016, 3, 2)] In [397]: pd.to_datetime(m, errors='coerce') Out[397]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [398]: m = ['apple', 2, 3] In [399]: pd.to_numeric(m0 码力 | 3231 页 | 10.87 MB | 1 年前3
 pandas: powerful Python data analysis toolkit - 1.1.0Release 1.1.0 (continued from previous page) A B C D min 1 1.0 bar 2013-01-01 sum 6 6.0 foobarbaz NaT Custom describe With .agg() it is possible to easily create a custom describe function, similar to if errors='coerce', these errors will be ignored and pandas will convert problematic elements to pd.NaT (for datetime and timedelta) or np.nan (for numeric). 2.3. Essential basic functionality 223 pandas: datetime.datetime(2016, 3, 2)] In [397]: pd.to_datetime(m, errors='coerce') Out[397]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [398]: m = ['apple', 2, 3] In [399]: pd.to_numeric(m0 码力 | 3229 页 | 10.87 MB | 1 年前3
共 29 条
- 1
 - 2
 - 3
 













