test_pandas.py 448 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Auther :liuyuqi.gov@msn.cn
  5. @Time :2018/7/5 3:08
  6. @File :test_pandas.py
  7. '''
  8. import pandas as pd ,numpy as np
  9. def t1():
  10. a = [['a', '1.2', '4.2'], ['b', '70', '0.03'], ['x', '5', '0']]
  11. df = pd.DataFrame(a, columns=list("ABC"))
  12. print(df.dtypes)
  13. print(df)
  14. def t2():
  15. obj = pd.Series(list('cadaabbcc'))
  16. uniques = obj.unique()
  17. print(obj.dtypes)
  18. print(uniques.shape)
  19. t2()