pandas: powerful Python data analysis toolkit - 0.25rename(columns={'one': 'foo', 'two': 'bar'}, .....: index={'a': 'apple', 'b': 'banana', 'd': 'durian'}) .....: Out[237]: foo bar three apple 0.280390 0.244345 NaN banana 1.169430 0.685821 1.063425 c 1 233237 d NaN 0.589941 0.853134 In [239]: df.rename({'a': 'apple', 'b': 'banana', 'd': 'durian'}, �→axis='index') Out[239]: one two three apple 0.280390 0.244345 NaN banana 1.169430 0.685821 1.063425 c m = ['apple', datetime.datetime(2016, 3, 2)] In [379]: pd.to_datetime(m, errors='coerce') Out[379]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [380]: m = ['apple', 2, 3]0 码力 | 698 页 | 4.91 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.19.0In [55]: store.append('food/apple', df) In [56]: store Out[56]:File path: store.h5 /foo/bar/bah frame (shape->[8,3]) ˓→ /food/apple frame_table (typ->appendable pandas Python version 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] nose version 1.3.7 2.2. Installing pandas 323 pandas: powerful Python data analysis rename(columns={'one' : 'foo', 'two' : 'bar'}, .....: index={'a' : 'apple', 'b' : 'banana', 'd' : 'durian'}) .....: Out[216]: foo three bar apple -0.626544 NaN -0.351587 banana -0.138894 -0.177289 1.136249 0 码力 | 1937 页 | 12.03 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.19.1In [55]: store.append('food/apple', df) In [56]: store Out[56]:File path: store.h5 /foo/bar/bah frame (shape->[8,3]) ˓→ /food/apple frame_table (typ->appendable pandas Python version 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] nose version 1.3.7 2.2. Installing pandas 325 pandas: powerful Python data analysis rename(columns={'one' : 'foo', 'two' : 'bar'}, .....: index={'a' : 'apple', 'b' : 'banana', 'd' : 'durian'}) .....: Out[216]: foo three bar apple -0.626544 NaN -0.351587 banana -0.138894 -0.177289 1.136249 0 码力 | 1943 页 | 12.06 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.20.3In [55]: store.append('food/apple', df) In [56]: store Out[56]:File path: store.h5 /foo/bar/bah frame (shape->[8,3]) ˓→ /food/apple frame_table (typ->appendable pandas Python version 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] nose version 1.3.7 ........................................................... index={'a' : 'apple', 'b' : 'banana', 'd' : 'durian'}) 9.7. Reindexing and altering labels 531 pandas: powerful Python data analysis toolkit, Release 0.20.3 .....: Out[254]: foo three bar apple -1.101558 0 码力 | 2045 页 | 9.18 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.21.1store.put('foo/bar/bah', df) In [47]: store.append('food/orange', df) In [48]: store.append('food/apple', df) In [49]: store Out[49]:File path: store.h5 # remove rename(columns={'one': 'foo', 'two': 'bar'}, .....: index={'a': 'apple', 'b': 'banana', 'd': 'durian'}) .....: Out[257]: foo three bar apple -1.101558 NaN 1.124472 banana -0.177289 -0.634293 2.487104 to. In [258]: df.rename({'one': 'foo', 'two': 'bar'}, axis='columns'}) .....: df.rename({'a': 'apple', 'b': 'banana', 'd': 'durian'}, axis='columns'}) .....: File " " 0 码力 | 2207 页 | 8.59 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.12append(’food/apple’, df) In [61]: storeFile path: store.h5 /wp wide_table (typ->appendable,nrows->16,ncols->2,indexers->[major_axis,minor_axis]) /food/apple frame_table rename(columns={’one’ : ’foo’, ’two’ : ’bar’}, .....: index={’a’ : ’apple’, ’b’ : ’banana’, ’d’ : ’durian’}) .....: foo three bar apple -0.701368 NaN -0.087103 banana 0.109333 -0.354359 0.637674 c -0 In [39]: data = ’a,b,c\n4,apple,bat,5.7\n8,orange,cow,10’ In [40]: pd.read_csv(StringIO(data)) a b c 4 apple bat 5.7 8 orange cow 10.0 In [41]: data = ’index,a,b,c\n4,apple,bat,5.7\n8,orange,cow,10’ 0 码力 | 657 页 | 3.58 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.20.2In [55]: store.append('food/apple', df) In [56]: store Out[56]:File path: store.h5 /foo/bar/bah frame (shape->[8,3]) ˓→ /food/apple frame_table (typ->appendable pandas Python version 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] nose version 1.3.7 ........................................................... rename(columns={'one' : 'foo', 'two' : 'bar'}, .....: index={'a' : 'apple', 'b' : 'banana', 'd' : 'durian'}) .....: Out[254]: foo three bar apple -1.101558 NaN 1.124472 banana -0.177289 -0.634293 2.487104 0 码力 | 1907 页 | 7.83 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.1rename(columns={'one': 'foo', 'two': 'bar'}, .....: index={'a': 'apple', 'b': 'banana', 'd': 'durian'}) .....: Out[245]: foo bar three apple 1.394981 1.772517 NaN banana 0.343054 1.912123 -0.050390 c 227435 d NaN 0.279344 -0.613172 In [247]: df.rename({'a': 'apple', 'b': 'banana', 'd': 'durian'}, axis='index') Out[247]: one two three apple 1.394981 1.772517 NaN banana 0.343054 1.912123 -0.050390 m = ['apple', 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]0 码力 | 3231 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.0rename(columns={'one': 'foo', 'two': 'bar'}, .....: index={'a': 'apple', 'b': 'banana', 'd': 'durian'}) .....: Out[245]: foo bar three apple 1.394981 1.772517 NaN banana 0.343054 1.912123 -0.050390 c 227435 d NaN 0.279344 -0.613172 In [247]: df.rename({'a': 'apple', 'b': 'banana', 'd': 'durian'}, axis='index') Out[247]: one two three apple 1.394981 1.772517 NaN banana 0.343054 1.912123 -0.050390 m = ['apple', 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]0 码力 | 3229 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.0rename(columns={'one': 'foo', 'two': 'bar'}, .....: index={'a': 'apple', 'b': 'banana', 'd': 'durian'}) .....: Out[242]: foo bar three apple 0.885838 0.127239 NaN banana 0.619658 -1.995475 0.425610 c 614036 d NaN 1.147066 1.191411 In [244]: df.rename({'a': 'apple', 'b': 'banana', 'd': 'durian'}, axis='index') Out[244]: one two three apple 0.885838 0.127239 NaN banana 0.619658 -1.995475 0.425610 m = ['apple', datetime.datetime(2016, 3, 2)] In [384]: pd.to_datetime(m, errors='coerce') Out[384]: DatetimeIndex(['NaT', '2016-03-02'], dtype='datetime64[ns]', freq=None) In [385]: m = ['apple', 2, 3]0 码力 | 3015 页 | 10.78 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4













