pandas: powerful Python data analysis toolkit - 0.24.0[54]: df = pd.read_csv(StringIO(data), engine='python', dtype=str, na_filter=True) In [55]: df.loc[0, 'b'] Out[55]: nan Notice how we now instead output np.nan itself instead of a stringified form of Augspurger • Tomasz Kluczkowski + • Tony Tao + • Triple0 + • Troels Nielsen + 1.8. Contributors 55 pandas: powerful Python data analysis toolkit, Release 0.24.0 • Tuhin Mahmud + • Tyler Reddy + 76 Chapter 3. Getting started pandas: powerful Python data analysis toolkit, Release 0.24.0 In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1]0 码力 | 2973 页 | 9.90 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.25.0inputs when both are Series (GH23293). In [54]: s1 = pd.Series([1, 2, 3], index=['a', 'b', 'c']) In [55]: s2 = pd.Series([3, 4, 5], index=['d', 'c', 'b']) In [56]: s1 Out[56]: a 1 b 2 c 3 Length: 3, allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] 'Aaba', 'Baca', np.nan, 'CABA', 'dog', 'cat']) (continues on next page) 3.2. 10 minutes to pandas 55 pandas: powerful Python data analysis toolkit, Release 0.25.0 (continued from previous page) In0 码力 | 2827 页 | 9.62 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.25.1inputs when both are Series (GH23293). In [54]: s1 = pd.Series([1, 2, 3], index=['a', 'b', 'c']) In [55]: s2 = pd.Series([3, 4, 5], index=['d', 'c', 'b']) In [56]: s1 Out[56]: a 1 b 2 c 3 Length: 3, allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] 'Aaba', 'Baca', np.nan, 'CABA', 'dog', 'cat']) (continues on next page) 3.2. 10 minutes to pandas 55 pandas: powerful Python data analysis toolkit, Release 0.25.1 (continued from previous page) In0 码力 | 2833 页 | 9.65 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.02013-01-01 00:00:00, dtype: float64 Selecting on a multi-axis by label: 2.3. 10 minutes to pandas 55 pandas: powerful Python data analysis toolkit, Release 1.0.0 In [27]: df.loc[:, ['A', 'B']] Out[27]: allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] Series([True]).bool() Out[53]: True In [54]: pd.Series([False]).bool() Out[54]: False In [55]: pd.DataFrame([[True]]).bool() Out[55]: True In [56]: pd.DataFrame([[False]]).bool() Out[56]: False Warning: You might0 码力 | 3015 页 | 10.78 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] london_mg_per_ ˓→cubic ratio_paris_antwerp datetime ˓→ (continues on next page) 1.4. Community tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.0.5 (continued from previous page) 2019-05-07 Series([True]).bool() Out[53]: True In [54]: pd.Series([False]).bool() Out[54]: False In [55]: pd.DataFrame([[True]]).bool() Out[55]: True In [56]: pd.DataFrame([[False]]).bool() Out[56]: False Warning: You might0 码力 | 3091 页 | 10.16 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.0.4allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] london_mg_per_ ˓→cubic ratio_paris_antwerp datetime ˓→ (continues on next page) 1.4. Community tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.0.4 (continued from previous page) 2019-05-07 Series([True]).bool() Out[53]: True In [54]: pd.Series([False]).bool() Out[54]: False In [55]: pd.DataFrame([[True]]).bool() Out[55]: True In [56]: pd.DataFrame([[False]]).bool() Out[56]: False Warning: You might0 码力 | 3081 页 | 10.24 MB | 1 年前3
pandas: powerful Python data analysis toolkit -1.0.3allows you to change/add/delete the index on a specified axis. This returns a copy of the data. In [55]: df1 = df.reindex(index=dates[0:4], columns=list(df.columns) + ['E']) In [56]: df1.loc[dates[0]:dates[1] in each of the pandas plot functions that are worthwhile to have a look. 2.4. Community tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.0.3 Some more formatting options are explained Series([True]).bool() Out[53]: True In [54]: pd.Series([False]).bool() Out[54]: False In [55]: pd.DataFrame([[True]]).bool() Out[55]: True In [56]: pd.DataFrame([[False]]).bool() Out[56]: False Warning: You might0 码力 | 3071 页 | 10.10 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.0that contains the surname of the Passengers by extracting the part before the comma. 1.4. Tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.1.0 In [5]: titanic["Name"].str.split(" into groups by1 and by2: df <- data.frame( v1 = c(1,3,5,7,8,3,5,NA,4,5,7,9), v2 = c(11,33,55,77,88,33,55,NA,44,55,77,99), by1 = c("red", "blue", 1, 2, NA, "big", 1, 2, "red", 1, NA, 12), by2 = c("wet", "dry" analysis toolkit, Release 1.1.0 (continued from previous page) ...: 'v2': [11, 33, 55, 77, 88, 33, 55, np.nan, 44, 55, 77, 99], ...: 'by1': ["red", "blue", 1, 2, np.nan, "big", 1, 2, "red", 1, np.nan0 码力 | 3229 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.1.1that contains the surname of the Passengers by extracting the part before the comma. 1.4. Tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.1.1 In [5]: titanic["Name"].str.split(" into groups by1 and by2: df <- data.frame( v1 = c(1,3,5,7,8,3,5,NA,4,5,7,9), v2 = c(11,33,55,77,88,33,55,NA,44,55,77,99), by1 = c("red", "blue", 1, 2, NA, "big", 1, 2, "red", 1, NA, 12), by2 = c("wet", "dry" analysis toolkit, Release 1.1.1 (continued from previous page) ...: 'v2': [11, 33, 55, 77, 88, 33, 55, np.nan, 44, 55, 77, 99], ...: 'by1': ["red", "blue", 1, 2, np.nan, "big", 1, 2, "red", 1, np.nan0 码力 | 3231 页 | 10.87 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 1.3.22019-05-31 00:00:00+00:00 74.5 97.0 97.0 2019-06-30 00:00:00+00:00 52.5 84.7 52.0 1.4. Tutorials 55 pandas: powerful Python data analysis toolkit, Release 1.3.2 A very powerful method on time series into groups by1 and by2: df <- data.frame( v1 = c(1,3,5,7,8,3,5,NA,4,5,7,9), v2 = c(11,33,55,77,88,33,55,NA,44,55,77,99), by1 = c("red", "blue", 1, 2, NA, "big", 1, 2, "red", 1, NA, 12), by2 = c("wet", "dry" previous page) ...: "v1": [1, 3, 5, 7, 8, 3, 5, np.nan, 4, 5, 7, 9], ...: "v2": [11, 33, 55, 77, 88, 33, 55, np.nan, 44, 55, 77, 99], ...: "by1": ["red", "blue", 1, 2, np.nan, "big", 1, 2, "red", 1, np.nan0 码力 | 3509 页 | 14.01 MB | 1 年前3
共 317 条
- 1
- 2
- 3
- 4
- 5
- 6
- 32













