PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/pandas/__init__.py

http://github.com/wesm/pandas
Python | 101 lines | 89 code | 7 blank | 5 comment | 6 complexity | 3960d81ba08b3c8ad51ac439c3c0f6cd MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0
  1. # pylint: disable-msg=W0614,W0401,W0611,W0622
  2. # flake8: noqa
  3. __docformat__ = 'restructuredtext'
  4. # Let users know if they're missing any of our hard dependencies
  5. hard_dependencies = ("numpy", "pytz", "dateutil")
  6. missing_dependencies = []
  7. for dependency in hard_dependencies:
  8. try:
  9. __import__(dependency)
  10. except ImportError as e:
  11. missing_dependencies.append(dependency)
  12. if missing_dependencies:
  13. raise ImportError(
  14. "Missing required dependencies {0}".format(missing_dependencies))
  15. del hard_dependencies, dependency, missing_dependencies
  16. # numpy compat
  17. from pandas.compat.numpy import *
  18. try:
  19. from pandas._libs import (hashtable as _hashtable,
  20. lib as _lib,
  21. tslib as _tslib)
  22. except ImportError as e: # pragma: no cover
  23. # hack but overkill to use re
  24. module = str(e).replace('cannot import name ', '')
  25. raise ImportError("C extension: {0} not built. If you want to import "
  26. "pandas from the source directory, you may need to run "
  27. "'python setup.py build_ext --inplace --force' to build "
  28. "the C extensions first.".format(module))
  29. from datetime import datetime
  30. # let init-time option registration happen
  31. import pandas.core.config_init
  32. from pandas.core.api import *
  33. from pandas.core.sparse.api import *
  34. from pandas.tseries.api import *
  35. from pandas.core.computation.api import *
  36. from pandas.core.reshape.api import *
  37. from pandas.util._print_versions import show_versions
  38. from pandas.io.api import *
  39. from pandas.util._tester import test
  40. import pandas.testing
  41. import pandas.arrays
  42. # use the closest tagged version if possible
  43. from ._version import get_versions
  44. v = get_versions()
  45. __version__ = v.get('closest-tag', v['version'])
  46. __git_version__ = v.get('full-revisionid')
  47. del get_versions, v
  48. # module level doc-string
  49. __doc__ = """
  50. pandas - a powerful data analysis and manipulation library for Python
  51. =====================================================================
  52. **pandas** is a Python package providing fast, flexible, and expressive data
  53. structures designed to make working with "relational" or "labeled" data both
  54. easy and intuitive. It aims to be the fundamental high-level building block for
  55. doing practical, **real world** data analysis in Python. Additionally, it has
  56. the broader goal of becoming **the most powerful and flexible open source data
  57. analysis / manipulation tool available in any language**. It is already well on
  58. its way toward this goal.
  59. Main Features
  60. -------------
  61. Here are just a few of the things that pandas does well:
  62. - Easy handling of missing data in floating point as well as non-floating
  63. point data.
  64. - Size mutability: columns can be inserted and deleted from DataFrame and
  65. higher dimensional objects
  66. - Automatic and explicit data alignment: objects can be explicitly aligned
  67. to a set of labels, or the user can simply ignore the labels and let
  68. `Series`, `DataFrame`, etc. automatically align the data for you in
  69. computations.
  70. - Powerful, flexible group by functionality to perform split-apply-combine
  71. operations on data sets, for both aggregating and transforming data.
  72. - Make it easy to convert ragged, differently-indexed data in other Python
  73. and NumPy data structures into DataFrame objects.
  74. - Intelligent label-based slicing, fancy indexing, and subsetting of large
  75. data sets.
  76. - Intuitive merging and joining data sets.
  77. - Flexible reshaping and pivoting of data sets.
  78. - Hierarchical labeling of axes (possible to have multiple labels per tick).
  79. - Robust IO tools for loading data from flat files (CSV and delimited),
  80. Excel files, databases, and saving/loading data from the ultrafast HDF5
  81. format.
  82. - Time series-specific functionality: date range generation and frequency
  83. conversion, moving window statistics, moving window linear regressions,
  84. date shifting and lagging, etc.
  85. """