Skip to content

Commit

Permalink
Merge pull request #1 from pandas-dev/master
Browse files Browse the repository at this point in the history
Merging with master
  • Loading branch information
Anjali2019 authored Oct 3, 2018
2 parents 1c500fb + b0f9a10 commit 8f823af
Show file tree
Hide file tree
Showing 255 changed files with 7,581 additions and 4,931 deletions.
1 change: 0 additions & 1 deletion .pep8speaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ pycodestyle:
ignore: # Errors and warnings to ignore
- E402, # module level import not at top of file
- E731, # do not assign a lambda expression, use a def
- E741, # do not use variables named 'l', 'O', or 'I'
- W503 # line break before binary operator
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ matrix:
exclude:
# Exclude the default Python 3.5 build
- python: 3.5
include:
- os: osx
language: generic
env:
- JOB="3.5, OSX" ENV_FILE="ci/travis-35-osx.yaml" TEST_ARGS="--skip-slow --skip-network"

include:
- dist: trusty
env:
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
Expand Down Expand Up @@ -64,7 +60,7 @@ matrix:
# In allow_failures
- dist: trusty
env:
- JOB="3.6, NumPy dev" ENV_FILE="ci/travis-36-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
addons:
apt:
packages:
Expand All @@ -79,7 +75,7 @@ matrix:
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
- dist: trusty
env:
- JOB="3.6, NumPy dev" ENV_FILE="ci/travis-36-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
addons:
apt:
packages:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<tr>
<td></td>
<td>
<a href="https://ci.appveyor.com/project/pandas-dev/pandas">
<img src="https://ci.appveyor.com/api/projects/status/86vn83mxgnl4xf1s/branch/master?svg=true" alt="appveyor build status" />
<a href="https://dev.azure.com/pandas-dev/pandas/_build/latest?definitionId=1&branch=master">
<img src="https://dev.azure.com/pandas-dev/pandas/_apis/build/status/pandas-dev.pandas?branch=master" alt="Azure Pipelines build status" />
</a>
</td>
</tr>
Expand Down
91 changes: 0 additions & 91 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion asv_bench/benchmarks/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
try:
hashing = import_module(imp)
break
except:
except (ImportError, TypeError, ValueError):
pass

from .pandas_vb_common import setup # noqa
Expand Down
13 changes: 10 additions & 3 deletions asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,21 @@ class NSort(object):
param_names = ['keep']

def setup(self, keep):
self.df = DataFrame(np.random.randn(1000, 3), columns=list('ABC'))
self.df = DataFrame(np.random.randn(100000, 3),
columns=list('ABC'))

def time_nlargest(self, keep):
def time_nlargest_one_column(self, keep):
self.df.nlargest(100, 'A', keep=keep)

def time_nsmallest(self, keep):
def time_nlargest_two_columns(self, keep):
self.df.nlargest(100, ['A', 'B'], keep=keep)

def time_nsmallest_one_column(self, keep):
self.df.nsmallest(100, 'A', keep=keep)

def time_nsmallest_two_columns(self, keep):
self.df.nsmallest(100, ['A', 'B'], keep=keep)


class Describe(object):

Expand Down
75 changes: 45 additions & 30 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,95 +11,110 @@
class NumericSeriesIndexing(object):

goal_time = 0.2
params = [Int64Index, Float64Index]
param = ['index']
params = [
(Int64Index, Float64Index),
('unique_monotonic_inc', 'nonunique_monotonic_inc'),
]
param_names = ['index_dtype', 'index_structure']

def setup(self, index):
def setup(self, index, index_structure):
N = 10**6
idx = index(range(N))
self.data = Series(np.random.rand(N), index=idx)
indices = {
'unique_monotonic_inc': index(range(N)),
'nonunique_monotonic_inc': index(
list(range(55)) + [54] + list(range(55, N - 1))),
}
self.data = Series(np.random.rand(N), index=indices[index_structure])
self.array = np.arange(10000)
self.array_list = self.array.tolist()

def time_getitem_scalar(self, index):
def time_getitem_scalar(self, index, index_structure):
self.data[800000]

def time_getitem_slice(self, index):
def time_getitem_slice(self, index, index_structure):
self.data[:800000]

def time_getitem_list_like(self, index):
def time_getitem_list_like(self, index, index_structure):
self.data[[800000]]

def time_getitem_array(self, index):
def time_getitem_array(self, index, index_structure):
self.data[self.array]

def time_getitem_lists(self, index):
def time_getitem_lists(self, index, index_structure):
self.data[self.array_list]

def time_iloc_array(self, index):
def time_iloc_array(self, index, index_structure):
self.data.iloc[self.array]

def time_iloc_list_like(self, index):
def time_iloc_list_like(self, index, index_structure):
self.data.iloc[[800000]]

def time_iloc_scalar(self, index):
def time_iloc_scalar(self, index, index_structure):
self.data.iloc[800000]

def time_iloc_slice(self, index):
def time_iloc_slice(self, index, index_structure):
self.data.iloc[:800000]

def time_ix_array(self, index):
def time_ix_array(self, index, index_structure):
self.data.ix[self.array]

def time_ix_list_like(self, index):
def time_ix_list_like(self, index, index_structure):
self.data.ix[[800000]]

def time_ix_scalar(self, index):
def time_ix_scalar(self, index, index_structure):
self.data.ix[800000]

def time_ix_slice(self, index):
def time_ix_slice(self, index, index_structure):
self.data.ix[:800000]

def time_loc_array(self, index):
def time_loc_array(self, index, index_structure):
self.data.loc[self.array]

def time_loc_list_like(self, index):
def time_loc_list_like(self, index, index_structure):
self.data.loc[[800000]]

def time_loc_scalar(self, index):
def time_loc_scalar(self, index, index_structure):
self.data.loc[800000]

def time_loc_slice(self, index):
def time_loc_slice(self, index, index_structure):
self.data.loc[:800000]


class NonNumericSeriesIndexing(object):

goal_time = 0.2
params = ['string', 'datetime']
param_names = ['index']
params = [
('string', 'datetime'),
('unique_monotonic_inc', 'nonunique_monotonic_inc'),
]
param_names = ['index_dtype', 'index_structure']

def setup(self, index):
N = 10**5
def setup(self, index, index_structure):
N = 10**6
indexes = {'string': tm.makeStringIndex(N),
'datetime': date_range('1900', periods=N, freq='s')}
index = indexes[index]
if index_structure == 'nonunique_monotonic_inc':
index = index.insert(item=index[2], loc=2)[:-1]
self.s = Series(np.random.rand(N), index=index)
self.lbl = index[80000]

def time_getitem_label_slice(self, index):
def time_getitem_label_slice(self, index, index_structure):
self.s[:self.lbl]

def time_getitem_pos_slice(self, index):
def time_getitem_pos_slice(self, index, index_structure):
self.s[:80000]

def time_get_value(self, index):
def time_get_value(self, index, index_structure):
with warnings.catch_warnings(record=True):
self.s.get_value(self.lbl)

def time_getitem_scalar(self, index):
def time_getitem_scalar(self, index, index_structure):
self.s[self.lbl]

def time_getitem_list_like(self, index, index_structure):
self.s[[self.lbl]]


class DataFrameStringIndexing(object):

Expand Down
6 changes: 2 additions & 4 deletions asv_bench/benchmarks/io/csv.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import random
import timeit
import string

import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Categorical, date_range, read_csv
from pandas.compat import PY2
from pandas.compat import cStringIO as StringIO

from ..pandas_vb_common import setup, BaseIO # noqa
Expand Down Expand Up @@ -181,8 +179,8 @@ def time_read_csv(self, sep, decimal, float_precision):
names=list('abc'), float_precision=float_precision)

def time_read_csv_python_engine(self, sep, decimal, float_precision):
read_csv(self.data(self.StringIO_input), sep=sep, header=None, engine='python',
float_precision=None, names=list('abc'))
read_csv(self.data(self.StringIO_input), sep=sep, header=None,
engine='python', float_precision=None, names=list('abc'))


class ReadCSVCategorical(BaseIO):
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/join_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setup(self):
try:
with warnings.catch_warnings(record=True):
self.mdf1.consolidate(inplace=True)
except:
except (AttributeError, TypeError):
pass
self.mdf2 = self.mdf1.copy()
self.mdf2.index = self.df2.index
Expand Down
5 changes: 2 additions & 3 deletions asv_bench/benchmarks/pandas_vb_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
from importlib import import_module

import numpy as np
from pandas import Panel

# Compatibility import for lib
for imp in ['pandas._libs.lib', 'pandas.lib']:
try:
lib = import_module(imp)
break
except:
except (ImportError, TypeError, ValueError):
pass

numeric_dtypes = [np.int64, np.int32, np.uint32, np.uint64, np.float32,
Expand All @@ -34,7 +33,7 @@ def remove(self, f):
"""Remove created files"""
try:
os.remove(f)
except:
except OSError:
# On Windows, attempting to remove a file that is in use
# causes an exception to be raised
pass
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/stat_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setup(self, op, dtype, axis, use_bottleneck):
df = pd.DataFrame(np.random.randn(100000, 4)).astype(dtype)
try:
pd.options.compute.use_bottleneck = use_bottleneck
except:
except TypeError:
from pandas.core import nanops
nanops._USE_BOTTLENECK = use_bottleneck
self.df_func = getattr(df, op)
Expand Down Expand Up @@ -56,7 +56,7 @@ def setup(self, op, dtype, use_bottleneck):
s = pd.Series(np.random.randn(100000)).astype(dtype)
try:
pd.options.compute.use_bottleneck = use_bottleneck
except:
except TypeError:
from pandas.core import nanops
nanops._USE_BOTTLENECK = use_bottleneck
self.s_func = getattr(s, op)
Expand Down
1 change: 0 additions & 1 deletion asv_bench/benchmarks/timeseries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from datetime import timedelta

import numpy as np
Expand Down
Loading

0 comments on commit 8f823af

Please sign in to comment.