39+ results for 'import pandas' (963 ms)
18from spyderlib.utils import programs 19from spyderlib import dependencies 20from spyderlib.baseconfig import _ 30 from numpy import ndarray 31 from numpy import array, matrix #@UnusedImport (object eval) 32 from numpy.ma import MaskedArray 56 57#----Pandas support 58PANDAS_REQVER = '>=0.13.1' 58PANDAS_REQVER = '>=0.13.1' 59dependencies.add('pandas', _("View and edit DataFrames and Series in the " 60 "Variable Explorer"), 62if programs.is_module_installed('pandas', PANDAS_REQVER): 63 from pandas import DataFrame, TimeSeries 64else:association.php http://logisticsouth.googlecode.com/svn/trunk/ | PHP | 106 lines
21 22 More importantly, when performing <b>QCubed Queries</b> across association tables, we can <b>Expand</b> on the many-to-many 23 relationship, which would use a special virtual attribute to help describe the individual object, itself, which was involved for the join. 26 27 And finally, on a similar note, you could instead use <b>ExpandAsArray</b> which would do a similar expansion 28 on the associated object, but store it as an array. See below for the differences of each. 76 <br/> 77 <h3>Same as above, but this time, use ExpandAsArray()</h3> 78 <i>Notice how each person is only listed once... but each person has an internal/virtual <b>_ProjectAsTeamMemberArray</b> which may list more than one project.</i><br/><br/> 83 // Let's ExpandArray on the Association Table, itself 84 QQ::ExpandAsArray(QQN::Person()->ProjectAsTeamMember), 85 // ExpandArray dictates that the PRIMARY sort MUST be on the root object (in this case, QQN::Person())TransporteGen.class.php http://logisticsouth.googlecode.com/svn/trunk/ | PHP | 1360 lines
24 * @property-read Importacion $_ImportacionAsTRANSPORTEIdTRANSPORTE the value for the private _objImportacionAsTRANSPORTEIdTRANSPORTE (Read-Only) if set due to an expansion on the IMPORTACION.TRANSPORTE_idTRANSPORTE reverse relationship 25 * @property-read Importacion[] $_ImportacionAsTRANSPORTEIdTRANSPORTEArray the value for the private _objImportacionAsTRANSPORTEIdTRANSPORTEArray (Read-Only) if set due to an ExpandAsArray on the IMPORTACION.TRANSPORTE_idTRANSPORTE reverse relationship 26 * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new) 78 * Private member variable that stores a reference to a single ImportacionAsTRANSPORTEIdTRANSPORTE object 79 * (of type Importacion), if this Transporte object was restored with 80 * an expansion on the IMPORTACION association table. 80 * an expansion on the IMPORTACION association table. 81 * @var Importacion _objImportacionAsTRANSPORTEIdTRANSPORTE; 82 */ 82 */ 83 private $_objImportacionAsTRANSPORTEIdTRANSPORTE; 84 88 * an ExpandAsArray on the IMPORTACION association table. 89 * @var Importacion[] _objImportacionAsTRANSPORTEIdTRANSPORTEArray; 90 */LicenciaGen.class.php http://logisticsouth.googlecode.com/svn/trunk/ | PHP | 3172 lines
40 * @property-read Importacion $_ImportacionAsLICENCIAIdLICENCIA the value for the private _objImportacionAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the IMPORTACION.LICENCIA_idLICENCIA reverse relationship 41 * @property-read Importacion[] $_ImportacionAsLICENCIAIdLICENCIAArray the value for the private _objImportacionAsLICENCIAIdLICENCIAArray (Read-Only) if set due to an ExpandAsArray on the IMPORTACION.LICENCIA_idLICENCIA reverse relationship 42 * @property-read ListaProducto $_ListaProductoAsLICENCIAIdLICENCIA the value for the private _objListaProductoAsLICENCIAIdLICENCIA (Read-Only) if set due to an expansion on the LISTA_PRODUCTO.LICENCIA_idLICENCIA reverse relationship 215 * Private member variable that stores a reference to a single ImportacionAsLICENCIAIdLICENCIA object 216 * (of type Importacion), if this Licencia object was restored with 217 * an expansion on the IMPORTACION association table. 217 * an expansion on the IMPORTACION association table. 218 * @var Importacion _objImportacionAsLICENCIAIdLICENCIA; 219 */ 222 /** 223 * Private member variable that stores a reference to an array of ImportacionAsLICENCIAIdLICENCIA objects 224 * (of type Importacion[]), if this Licencia object was restored with 225 * an ExpandAsArray on the IMPORTACION association table. 226 * @var Importacion[] _objImportacionAsLICENCIAIdLICENCIAArray; 227 */PaisGen.class.php http://logisticsouth.googlecode.com/svn/trunk/ | PHP | 1772 lines
20 * @property-read Importacion $_ImportacionAsPAISOrigen the value for the private _objImportacionAsPAISOrigen (Read-Only) if set due to an expansion on the IMPORTACION.PAIS_Origen reverse relationship 21 * @property-read Importacion[] $_ImportacionAsPAISOrigenArray the value for the private _objImportacionAsPAISOrigenArray (Read-Only) if set due to an ExpandAsArray on the IMPORTACION.PAIS_Origen reverse relationship 22 * @property-read Importacion $_ImportacionAsPAISDestino the value for the private _objImportacionAsPAISDestino (Read-Only) if set due to an expansion on the IMPORTACION.PAIS_Destino reverse relationship 22 * @property-read Importacion $_ImportacionAsPAISDestino the value for the private _objImportacionAsPAISDestino (Read-Only) if set due to an expansion on the IMPORTACION.PAIS_Destino reverse relationship 23 * @property-read Importacion[] $_ImportacionAsPAISDestinoArray the value for the private _objImportacionAsPAISDestinoArray (Read-Only) if set due to an ExpandAsArray on the IMPORTACION.PAIS_Destino reverse relationship 24 * @property-read Proveedor $_ProveedorAsPAISIdPAIS the value for the private _objProveedorAsPAISIdPAIS (Read-Only) if set due to an expansion on the PROVEEDOR.PAIS_idPAIS reverse relationship 63 * (of type Importacion[]), if this Pais object was restored with 64 * an ExpandAsArray on the IMPORTACION association table. 65 * @var Importacion[] _objImportacionAsPAISOrigenArray; 72 * an expansion on the IMPORTACION association table. 73 * @var Importacion _objImportacionAsPAISDestino; 74 */ 80 * an ExpandAsArray on the IMPORTACION association table. 81 * @var Importacion[] _objImportacionAsPAISDestinoArray; 82 */timeseries.py git://github.com/pydata/pandas.git | Python | 336 lines
3 4common_setup = """from pandas_vb_common import * 5from datetime import timedelta 162setup = common_setup + """ 163from pandas.tseries.frequencies import infer_freq 164rng = date_range('1/1/1700', freq='D', periods=100000) 190setup = common_setup + """ 191from pandas.tseries.offsets import Second 192s1 = date_range('1/1/2000', periods=100, freq='S') 276setup = common_setup + """ 277from pandas.tseries.converter import DatetimeConverter 278""" 286import datetime as dt 287import pandas as pd 288import numpy as npdiagnostics.py git://github.com/jseabold/pymc.git | Python | 178 lines
2 3import numpy as np 4from .stats import autocorr, autocov, statfunc 4from .stats import autocorr, autocov, statfunc 5from copy import copy 6 172def trace_to_dataframe(trace): 173 """Convert a PyMC trace consisting of 1-D variables to a pandas DataFrame 174 """ 174 """ 175 import pandas as pd 176 return pd.DataFrame(comparison_with_r.rst git://github.com/pydata/pandas.git | ReStructuredText | 480 lines
6 7 import pandas as pd 8 import numpy as np 90 91 from pandas import DataFrame 92 df = DataFrame({ 161 162In ``pandas`` we may use :meth:`~pandas.pivot_table` method to handle this: 163 166 import random 167 import string 168 193 194In ``pandas``, there are a few ways to perform subsetting. You can use 195:meth:`~pandas.DataFrame.query` or pass an expression as if it were anmisc.py git://github.com/wesm/pandas.git | Python | 390 lines
1from numpy import NaN 2from pandas import compat 3import numpy as np 4 5from pandas.core.api import Series, DataFrame 6from pandas.core.series import remove_na 7from pandas.compat import zip, lrange 8import pandas.core.common as com 9JSRewriter.scala git://github.com/jankroken/jsengine.git | Scala | 172 lines
2 3import jsengine.ast._ 4 18 case AssignmentExpression(operator, leftHand, rightHand) => { 19 def expandAssignment(operator: Operator, leftHand: JSBaseExpression, rightHand: JSBaseExpression): Assign = { 20 Assign(rewriteExpression(leftHand), 24 case Operator("=") => Assign(rewriteExpression(leftHand), rewriteExpression(rightHand)) 25 case Operator("*=") => expandAssignment(Operator("*"),leftHand, rightHand) 26 case Operator("/=") => expandAssignment(Operator("/"),leftHand, rightHand) 26 case Operator("/=") => expandAssignment(Operator("/"),leftHand, rightHand) 27 case Operator("%=") => expandAssignment(Operator("%"),leftHand, rightHand) 28 case Operator("+=") => expandAssignment(Operator("+"),leftHand, rightHand) 28 case Operator("+=") => expandAssignment(Operator("+"),leftHand, rightHand) 29 case Operator("-=") => expandAssignment(Operator("_"),leftHand, rightHand) 30 case Operator("<<=") => expandAssignment(Operator("<<"),leftHand, rightHand)variant.d http://dotmars.googlecode.com/svn/trunk/ | D | 232 lines
11 12import dotmars.base.tuple; 13import dotmars.base.stdexcept; 218 T opModAssign(T)( T rhs ) { return (*this = get!(T) % rhs); } 219 T opAndAssign(T)( T rhs ) { return (*this = get!(T) & rhs); } 220 T opOrAssign(T)( T rhs ) { return (*this = get!(T) | rhs); }glm.py git://github.com/jseabold/pymc.git | Python | 206 lines
2from ..core import * 3from ..distributions import * 4from ..tuning.starting import find_MAP 4from ..tuning.starting import find_MAP 5import patsy 6import theano 6import theano 7import pandas as pd 8from collections import defaultdict 8from collections import defaultdict 9from statsmodels.formula.api import glm as glm_sm 10import statsmodels.api as sm 10import statsmodels.api as sm 11from pandas.tools.plotting import scatter_matrix 12autocomplete.d http://poseidonide.googlecode.com/svn/trunk/ | D | 1372 lines
141{ 142 private import poseidon.globals; 143 private import dwt.all; 154 MRUComplete mruParser; 155 ImportComplete importParser; 156 160 mruParser = new MRUComplete; 161 importParser = new ImportComplete; 162 } 561 CAnalyzerTreeNode[] importModules; 562 //if( getImport( "dummy", D_ALL, headNode, importModules, true ) !is null ) 563 //{ 563 //{ 564 getImport( "dummy", D_ALL, headNode, importModules, true ); 565 int DType = D_UDTS | D_FUNCTION | D_ALIAS | D_TYPEDEF | D_VARIABLE | D_IMPORT;misc.py git://github.com/pydata/pandas.git | Python | 387 lines
1from numpy import NaN 2from pandas import compat 3import numpy as np 4 5from pandas.core.api import Series, DataFrame, isnull, notnull 6from pandas.core.series import remove_na 6from pandas.core.series import remove_na 7from pandas.compat import zip 8importwizard.py https://code.google.com/p/spyderlib/ | Python | 636 lines
20 Slot) 21from spyderlib.qt.compat import to_qvariant 22 22 23from functools import partial as ft_partial 24 25try: 26 import pandas as pd 27except ImportError: 33from spyderlib.utils.qthelpers import get_icon, add_actions, create_action 34from spyderlib.py3compat import (TEXT_TYPES, INT_TYPES, to_text_string, u, 35 zip_longest, io) 378 if programs.is_module_installed('numpy'): 379 from numpy import nan 380 out = list(zip_longest(*out, fillvalue=nan))iofuncs.py https://code.google.com/p/spyderlib/ | Python | 570 lines
17import os 18import tarfile 19import os.path as osp 19import os.path as osp 20import shutil 21import warnings 25try: 26 import pandas as pd 27except ImportError: 29 30# Local imports 31from spyderlib.py3compat import pickle, to_text_string, getcwd, PY2 201try: 202 from spyderlib.pil_patch import Image 203 if sys.byteorder == 'little':plot_epochs_as_data_frame.py git://github.com/mne-tools/mne-python.git | Python | 231 lines
18It knows about linear algebra and element-wise operations but is size mutable 19and allows for labeled access to its data. In addition, the pandas data frame 20class provides many useful methods for restructuring, reshaping and visualizing 48designs. To take control of this feature, on export, you can specify which 49of the three dimensions 'condition', 'epoch' and 'time' is passed to the Pandas 50index using the index parameter. Note that this decision is revertible any 85More information and additional introductory materials can be found at the 86pandas doc sites: http://pandas.pydata.org/pandas-docs/stable/ 87""" 94import mne 95import pylab as pl 96import numpy as np 227# 228# import pandas as pd 229# group = pd.concat([df_1, df_2])JarBuilder.java git://github.com/apache/hadoop-common.git | Java | 208 lines
20 21import java.io.*; 22import java.util.*; 22import java.util.*; 23import java.util.jar.*; 24import java.util.zip.ZipException; 187 String ext = jarFiles.fileExtension(f); 188 boolean expandAsJar = ext.equals("jar") || ext.equals("zip"); 189 if (expandAsJar) {reshaping.rst git://github.com/pydata/pandas.git | ReStructuredText | 459 lines
8 np.random.seed(123456) 9 from pandas import * 10 options.display.max_rows=15 11 from pandas.core.reshape import * 12 import pandas.util.testing as tm 13 randn = np.random.randn 15 from pandas.tools.tile import * 16 from pandas.compat import zip 17 27 28 In [1]: import pandas.util.testing as tm; tm.N = 3 29 52 53 import pandas.util.testing as tm; tm.N = 3 54 def unpivot(frame):faq.rst git://github.com/scikit-learn/scikit-learn.git | ReStructuredText | 413 lines
48The problem should be reproducible by simply copy-pasting your code snippet in a Python 49shell with scikit-learn installed. Do not forget to include the import statements. 50 88or scipy sparse matrices. Other types that are convertible to numeric 89arrays such as pandas DataFrame are also acceptable. 90 109 110The contributor should support the importance of the proposed addition with 111research papers and/or implementations in other similar packages, demonstrate 223 224 >>> from leven import levenshtein # doctest: +SKIP 225 >>> import numpy as np 225 >>> import numpy as np 226 >>> from sklearn.cluster import dbscan 227 >>> data = ["ACCTCCTAGAAG", "ACCTACTAGAAGTT", "GAATATTAGGCCGA"]test_estimator_checks.py git://github.com/scikit-learn/scikit-learn.git | Python | 633 lines
9 10from sklearn.base import BaseEstimator, ClassifierMixin 11from sklearn.utils import deprecated 29from sklearn.ensemble import RandomForestClassifier 30from sklearn.linear_model import LinearRegression, SGDClassifier 31from sklearn.mixture import GaussianMixture 190 # Function is only called after we verify that pandas is installed 191 from pandas import Series 192 if isinstance(sample_weight, Series): 289 try: 290 from pandas import DataFrame 291 if isinstance(X, DataFrame): 387 try: 388 from pandas import Series # noqa 389 msg = ("Estimator NoSampleWeightPandasSeriesType raises error if "estimator_checks.py git://github.com/scikit-learn/scikit-learn.git | Python | 3047 lines
1import types 2import warnings 2import warnings 3import sys 4import traceback 4import traceback 5import pickle 6import re 6import re 7from copy import deepcopy 8from functools import partial 8from functools import partial 9from itertools import chain 10from inspect import signature 11 12import numpy as np 13from scipy import sparseindexing.py git://github.com/wesm/pandas.git | Python | 293 lines
1from vbench.benchmark import Benchmark 2from datetime import datetime 5 6common_setup = """from .pandas_vb_common import * 7""" 143try: 144 import pandas.computation.expressions as expr 145except: 161try: 162 import pandas.computation.expressions as expr 163except: 256n=100000 257mdt = pandas.DataFrame() 258mdt['A'] = np.random.choice(range(10000,45000,1000), n)__init__.py http://ultra-finance.googlecode.com/svn/trunk/ | Python | 360 lines
5''' 6from pandas import * 7from math import *test_moments.py git://github.com/wesm/pandas.git | Python | 310 lines
1import unittest 2import nose 3 4from datetime import datetime 5from numpy.random import randn 5from numpy.random import randn 6import numpy as np 7 7 8from pandas.core.api import Series, DataFrame, DateRange 9from pandas.util.testing import assert_almost_equal 9from pandas.util.testing import assert_almost_equal 10import pandas.core.datetools as datetools 11import pandas.stats.moments as mom 11import pandas.stats.moments as mom 12import pandas.util.testing as tm 13bitarray.d https://bitbucket.org/prokhin_alexey/ldc2/ | D | 0 lines
9 10private import std.intrinsic; 11 682 */ 683 BitArray opAndAssign(BitArray e2) 684 in 698 { 699 debug(bitarray) printf("BitArray.opAndAssign unittest\n"); 700test_math.py git://github.com/pydata/pandas.git | Python | 68 lines
1import nose 2 4from numpy.random import randn 5import numpy as np 6 6 7from pandas.core.api import Series, DataFrame, date_range 8from pandas.util.testing import assert_almost_equal 8from pandas.util.testing import assert_almost_equal 9import pandas.core.datetools as datetools 10import pandas.stats.moments as mom 10import pandas.stats.moments as mom 11import pandas.util.testing as tm 12import pandas.stats.math as pmath 12import pandas.stats.math as pmath 13import pandas.tests.test_series as ts 14from pandas import olsdecorators.py git://github.com/wesm/pandas.git | Python | 293 lines
1from pandas.compat import StringIO, callable, signature 2from pandas.lib import cache_readonly # noqa 2from pandas.lib import cache_readonly # noqa 3import sys 4import warnings 4import warnings 5from textwrap import dedent 6from functools import wraps 217 make the decision. This is useful for tests that may require costly 218 imports, to delay the cost until the test suite is actually executed. 219 251 def knownfail_decorator(f): 252 # Local import to avoid a hard nose dependency and only incur the 253 # import time overhead at actual test-time. 253 # import time overhead at actual test-time. 254 import nose 255list.py git://github.com/wesm/pandas.git | Python | 144 lines
1import numpy as np 2from pandas.core.base import PandasObject 3from pandas.formats.printing import pprint_thing 4 5from pandas.types.common import is_scalar 6from pandas.sparse.array import SparseArray 6from pandas.sparse.array import SparseArray 7import pandas._sparse as splib 8 9 10class SparseList(PandasObject): 11interface.py git://github.com/pydata/pandas.git | Python | 136 lines
1from pandas.core.api import Series, DataFrame, Panel, MultiIndex 2from pandas.stats.ols import OLS, MovingOLS 3from pandas.stats.plm import PanelOLS, MovingPanelOLS, NonPooledPanelOLS 4import pandas.stats.common as common 5tile.py git://github.com/pydata/pandas.git | Python | 267 lines
4 5from pandas.core.api import DataFrame, Series 6from pandas.core.categorical import Categorical 7from pandas.core.index import _ensure_index 8import pandas.core.algorithms as algos 9import pandas.core.common as com 9import pandas.core.common as com 10import pandas.core.nanops as nanops 11from pandas.compat import zip 12 13import numpy as np 14plot_stock_market.py git://github.com/scikit-learn/scikit-learn.git | Python | 261 lines
65 66import sys 67 67 68import numpy as np 69import matplotlib.pyplot as plt 69import matplotlib.pyplot as plt 70from matplotlib.collections import LineCollection 71 71 72import pandas as pd 73 73 74from sklearn import cluster, covariance, manifold 75test_common.py git://github.com/pydata/pandas.git | Python | 189 lines
1import collections 2from functools import partial 2from functools import partial 3import string 4 4 5import numpy as np 6import pytest 7 8import pandas as pd 9from pandas import Series 9from pandas import Series 10import pandas._testing as tm 11from pandas.core import ops 11from pandas.core import ops 12import pandas.core.common as com 13from pandas.util.version import Versionreindex.py git://github.com/wesm/pandas.git | Python | 226 lines
1from vbench.benchmark import Benchmark 2from datetime import datetime 3 4common_setup = """from .pandas_vb_common import * 5""" 204#---------------------------------------------------------------------- 205# blog "pandas escaped the zoo" 206 211def sample(values, k): 212 from random import shuffle 213 sampler = np.arange(len(values))bigint.d https://dnet.svn.codeplex.com/svn | D | 2274 lines
49 50import std.string : format; 51import std.stdio : writef, writefln; 51import std.stdio : writef, writefln; 52import std.algorithm : min, max, swap, reverse; 53import std.traits : isIntegral; 53import std.traits : isIntegral; 54import std.contracts : assumeUnique; 55 417 /// 418 void opAndAssign(T:uint)(T n) 419 { 424 /// 425 void opAndAssign(T)(T n) 426 {sdo.py git://github.com/sunpy/sunpy.git | Python | 105 lines
2"""Provides programs to process and analyze EVE data.""" 3from __future__ import absolute_import 4 4 5from sunpy.lightcurve import LightCurve 6 7import os 8from pandas.io.parsers import read_csv 9from datetime import datetime 15 -------- 16 >>> import sunpy 17 >>> eve = sunpy.lightcurve.EVELightCurve() 43 #LightCurve.show(kwargs) 44 from matplotlib import pyplot as plt 45 self.data.plot(**kwargs)binary_ops.py git://github.com/wesm/pandas.git | Python | 200 lines
23setup = common_setup + """ 24import pandas.computation.expressions as expr 25df = DataFrame(np.random.randn(20000, 100)) 34setup = common_setup + """ 35import pandas.computation.expressions as expr 36df = DataFrame(np.random.randn(20000, 100)) 55setup = common_setup + """ 56import pandas.computation.expressions as expr 57df = DataFrame(np.random.randn(20000, 100)) 65setup = common_setup + """ 66import pandas.computation.expressions as expr 67df = DataFrame(np.random.randn(20000, 100)) 131setup = common_setup + """ 132import pandas.computation.expressions as expr 133df = DataFrame(np.random.randn(20000, 100))pivot.py git://github.com/pydata/pandas.git | Python | 410 lines
4 5from pandas import Series, DataFrame 6from pandas.core.index import MultiIndex 6from pandas.core.index import MultiIndex 7from pandas.core.groupby import Grouper 8from pandas.tools.merge import concat 8from pandas.tools.merge import concat 9from pandas.tools.util import cartesian_product 10from pandas.compat import range, lrange, zip 10from pandas.compat import range, lrange, zip 11from pandas.util.decorators import deprecate_kwarg 12from pandas import compat 12from pandas import compat 13import pandas.core.common as com 14import numpy as npcommon.py git://github.com/wesm/pandas.git | Python | 163 lines
3 4from datetime import datetime 5import string 5import string 6import nose 7 7 8import numpy as np 9 9 10from pandas import DataFrame, bdate_range 11from pandas.util.testing import assert_almost_equal # imported in other tests 11from pandas.util.testing import assert_almost_equal # imported in other tests 12import pandas.util.testing as tm 13