PageRenderTime 36ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/pandas/core/api.py

https://github.com/neurodebian/pandas
Python | 81 lines | 59 code | 17 blank | 5 comment | 2 complexity | b2b6e5d4532ebb0101b4c1791c64345f MD5 | raw file
  1. # pylint: disable=W0614,W0401,W0611
  2. # flake8: noqa
  3. import numpy as np
  4. from pandas.core.algorithms import factorize, unique, value_counts
  5. from pandas.core.dtypes.missing import isna, isnull, notna, notnull
  6. from pandas.core.categorical import Categorical
  7. from pandas.core.groupby import Grouper
  8. from pandas.io.formats.format import set_eng_float_format
  9. from pandas.core.index import (Index, CategoricalIndex, Int64Index,
  10. UInt64Index, RangeIndex, Float64Index,
  11. MultiIndex, IntervalIndex,
  12. TimedeltaIndex, DatetimeIndex,
  13. PeriodIndex, NaT)
  14. from pandas.core.indexes.period import Period, period_range, pnow
  15. from pandas.core.indexes.timedeltas import Timedelta, timedelta_range
  16. from pandas.core.indexes.datetimes import Timestamp, date_range, bdate_range
  17. from pandas.core.indexes.interval import Interval, interval_range
  18. from pandas.core.series import Series
  19. from pandas.core.frame import DataFrame
  20. from pandas.core.panel import Panel, WidePanel
  21. from pandas.core.panel4d import Panel4D
  22. from pandas.core.reshape.reshape import (
  23. pivot_simple as pivot, get_dummies,
  24. lreshape, wide_to_long)
  25. from pandas.core.indexing import IndexSlice
  26. from pandas.core.tools.numeric import to_numeric
  27. from pandas.tseries.offsets import DateOffset
  28. from pandas.core.tools.datetimes import to_datetime
  29. from pandas.core.tools.timedeltas import to_timedelta
  30. # see gh-14094.
  31. from pandas.util._depr_module import _DeprecatedModule
  32. _removals = ['day', 'bday', 'businessDay', 'cday', 'customBusinessDay',
  33. 'customBusinessMonthEnd', 'customBusinessMonthBegin',
  34. 'monthEnd', 'yearEnd', 'yearBegin', 'bmonthEnd', 'bmonthBegin',
  35. 'cbmonthEnd', 'cbmonthBegin', 'bquarterEnd', 'quarterEnd',
  36. 'byearEnd', 'week']
  37. datetools = _DeprecatedModule(deprmod='pandas.core.datetools',
  38. removals=_removals)
  39. from pandas.core.config import (get_option, set_option, reset_option,
  40. describe_option, option_context, options)
  41. # deprecation, xref #13790
  42. def match(*args, **kwargs):
  43. import warnings
  44. warnings.warn("pd.match() is deprecated and will be removed "
  45. "in a future version",
  46. FutureWarning, stacklevel=2)
  47. from pandas.core.algorithms import match
  48. return match(*args, **kwargs)
  49. def groupby(*args, **kwargs):
  50. import warnings
  51. warnings.warn("pd.groupby() is deprecated and will be removed; "
  52. "Please use the Series.groupby() or "
  53. "DataFrame.groupby() methods",
  54. FutureWarning, stacklevel=2)
  55. return args[0].groupby(*args[1:], **kwargs)
  56. # deprecation, xref
  57. class TimeGrouper(object):
  58. def __new__(cls, *args, **kwargs):
  59. from pandas.core.resample import TimeGrouper
  60. import warnings
  61. warnings.warn("pd.TimeGrouper is deprecated and will be removed; "
  62. "Please use pd.Grouper(freq=...)",
  63. FutureWarning, stacklevel=2)
  64. return TimeGrouper(*args, **kwargs)