本文整理汇总了Python中pandas.util.testing.getSeriesData方法的典型用法代码示例。如果您正苦于以下问题:Python testing.getSeriesData方法的具体用法?Python testing.getSeriesData怎么用?Python testing.getSeriesData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.util.testing
的用法示例。
在下文中一共展示了testing.getSeriesData方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_method
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def setup_method(self, method):
self.frame = DataFrame(tm.getSeriesData())
self.mixed_frame = self.frame.copy()
self.mixed_frame['foo'] = 'bar'
示例2: seriesd
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def seriesd():
return tm.getSeriesData()
示例3: float_frame
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_frame():
"""
Fixture for DataFrame of floats with index of unique strings
Columns are ['A', 'B', 'C', 'D'].
"""
return DataFrame(tm.getSeriesData())
示例4: float_frame_with_na
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_frame_with_na():
"""
Fixture for DataFrame of floats with index of unique strings
Columns are ['A', 'B', 'C', 'D']; some entries are missing
"""
df = DataFrame(tm.getSeriesData())
# set some NAs
df.loc[5:10] = np.nan
df.loc[15:20, -2:] = np.nan
return df
示例5: bool_frame_with_na
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def bool_frame_with_na():
"""
Fixture for DataFrame of booleans with index of unique strings
Columns are ['A', 'B', 'C', 'D']; some entries are missing
"""
df = DataFrame(tm.getSeriesData()) > 0
df = df.astype(object)
# set some NAs
df.loc[5:10] = np.nan
df.loc[15:20, -2:] = np.nan
return df
示例6: int_frame
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def int_frame():
"""
Fixture for DataFrame of ints with index of unique strings
Columns are ['A', 'B', 'C', 'D']
"""
df = DataFrame({k: v.astype(int)
for k, v in compat.iteritems(tm.getSeriesData())})
# force these all to int64 to avoid platform testing issues
return DataFrame({c: s for c, s in compat.iteritems(df)}, dtype=np.int64)
示例7: float_string_frame
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def float_string_frame():
"""
Fixture for DataFrame of floats and strings with index of unique strings
Columns are ['A', 'B', 'C', 'D', 'foo'].
"""
df = DataFrame(tm.getSeriesData())
df['foo'] = 'bar'
return df
示例8: mixed_float_frame
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def mixed_float_frame():
"""
Fixture for DataFrame of different float types with index of unique strings
Columns are ['A', 'B', 'C', 'D'].
"""
df = DataFrame(tm.getSeriesData())
df.A = df.A.astype('float32')
df.B = df.B.astype('float32')
df.C = df.C.astype('float16')
df.D = df.D.astype('float64')
return df
示例9: mixed_float_frame2
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def mixed_float_frame2():
"""
Fixture for DataFrame of different float types with index of unique strings
Columns are ['A', 'B', 'C', 'D'].
"""
df = DataFrame(tm.getSeriesData())
df.D = df.D.astype('float32')
df.C = df.C.astype('float32')
df.B = df.B.astype('float16')
df.D = df.D.astype('float64')
return df
示例10: test_invert
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_invert(self):
_seriesd = tm.getSeriesData()
df = pd.DataFrame(_seriesd)
assert_frame_equal(-(df < 0), ~(df < 0))
示例11: frame
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def frame():
return DataFrame(tm.getSeriesData())
示例12: test_to_html_columns_arg
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_to_html_columns_arg():
df = DataFrame(tm.getSeriesData())
result = df.to_html(columns=['A'])
assert '<th>B</th>' not in result
示例13: test_to_html_columns_arg
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def test_to_html_columns_arg(self):
frame = DataFrame(tm.getSeriesData())
result = frame.to_html(columns=['A'])
assert '<th>B</th>' not in result
示例14: setUp
# 需要导入模块: from pandas.util import testing [as 别名]
# 或者: from pandas.util.testing import getSeriesData [as 别名]
def setUp(self):
self.frame = DataFrame(tm.getSeriesData())
self.mixed_frame = self.frame.copy()
self.mixed_frame['foo'] = 'bar'