8000 CLN: use float64_t consistently instead of double, double_t by jbrockmendel · Pull Request #23583 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CLN: use float64_t consistently instead of double, double_t #23583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove non-standard imports of np.nan
  • Loading branch information
jbrockmendel committed Nov 8, 2018
commit d1511f7001d7251bb1820a4b35ed8260dbcdb33a
4 changes: 2 additions & 2 deletions pandas/tests/arrays/sparse/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import warnings

import numpy as np
from numpy import nan
import pytest

from pandas._libs.sparse import IntIndex
Expand All @@ -24,7 +23,8 @@ def kind(request):
class TestSparseArray(object):

def setup_method(self, method):
self.arr_data = np.array([nan, nan, 1, 2, 3, nan, 4, 5, nan, 6])
self.arr_data = np.array([np.nan, np.nan, 1, 2, 3,
np.nan, 4, 5, np.nan, 6])
self.arr = SparseArray(self.arr_data)
self.zarr = SparseArray([0, 0, 1, 2, 3, 0, 4, 5, 0, 6], fill_value=0)

Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/frame/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pytest

from numpy import nan
import numpy as np

from pandas.compat import range
Expand Down Expand Up @@ -328,7 +327,7 @@ def test_combineFrame(self):
frame_copy = self.frame.reindex(self.frame.index[::2])

del frame_copy['D']
frame_copy['C'][:5] = nan
frame_copy['C'][:5] = np.nan

added = self.frame + frame_copy

Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/frame/test_repr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import sys
import textwrap

from numpy import nan
import numpy as np
import pytest

Expand Down Expand Up @@ -49,8 +48,8 @@ def test_repr_mixed_big(self):
biggie = DataFrame({'A': np.random.randn(200),
'B': tm.makeStringIndex(200)},
index=lrange(200))
biggie.loc[:20, 'A'] = nan
biggie.loc[:20, 'B'] = nan
biggie.loc[:20, 'A'] = np.nan
biggie.loc[:20, 'B'] = np.nan

foo = repr(biggie) # noqa

Expand Down
7 changes: 3 additions & 4 deletions pandas/tests/frame/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pytest

from numpy import nan
from numpy.random import randn
import numpy as np

Expand Down Expand Up @@ -517,8 +516,8 @@ def test_first_last_valid(self, data, idx,
expected_first, expected_last):
N = len(self.frame.index)
mat = randn(N)
mat[:5] = nan
mat[-5:] = nan
mat[:5] = np.nan
mat[-5:] = np.nan

frame = DataFrame({'foo': mat}, index=self.frame.index)
index = frame.first_valid_index()
Expand All @@ -534,7 +533,7 @@ def test_first_last_valid(self, data, idx,
assert empty.first_valid_index() is None

# GH17400: no valid entries
frame[:] = nan
frame[:] = np.nan
assert frame.last_valid_index() is None
assert frame.first_valid_index() is None

Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/frame/test_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import csv
import pytest

from numpy import nan
import numpy as np

from pandas.compat import (lmap, range, lrange, StringIO, u)
Expand Down Expand Up @@ -52,7 +51,7 @@ def test_from_csv_deprecation(self):
def test_to_csv_from_csv1(self):

with ensure_clean('__tmp_to_csv_from_csv1__') as path:
self.frame['A'][:5] = nan
self.frame['A'][:5] = np.nan

self.frame.to_csv(path)
self.frame.to_csv(path, columns=['A', 'B'])
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/groupby/aggregate/test_cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import pytest

import numpy as np
from numpy import nan
import pandas as pd

from pandas import (bdate_range, DataFrame, Index, Series, Timestamp,
Expand All @@ -36,11 +35,11 @@
'max',
])
def test_cythonized_aggers(op_name):
data = {'A': [0, 0, 0, 0, 1, 1, 1, 1, 1, 1., nan, nan],
data = {'A': [0, 0, 0, 0, 1, 1, 1, 1, 1, 1., np.nan, np.nan],
'B': ['A', 'B'] * 6,
'C': np.random.randn(12)}
df = DataFrame(data)
df.loc[2:10:2, 'C'] = nan
df.loc[2:10:2, 'C'] = np.nan

op = lambda x: getattr(x, op_name)()

Expand Down
9 changes: 4 additions & 5 deletions pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import operator

import numpy as np
from numpy import nan
import pytest

import pandas.compat as compat
Expand Down Expand Up @@ -750,12 +749,12 @@ def _check_fill(meth, op, a, b, fill_value=0):
with np.errstate(all='ignore'):
if amask[i]:
if bmask[i]:
exp_values.append(nan)
exp_values.append(np.nan)
continue
exp_values.append(op(fill_value, b[i]))
elif bmask[i]:
if amask[i]:
exp_values.append(nan)
exp_values.append(np.nan)
continue
exp_values.append(op(a[i], fill_value))
else:
Expand All @@ -765,8 +764,8 @@ def _check_fill(meth, op, a, b, fill_value=0):
expected = Series(exp_values, exp_index)
assert_series_equal(result, expected)

a = Series([nan, 1., 2., 3., nan], index=np.arange(5))
b = Series([nan, 1, nan, 3, nan, 4.], index=np.arange(6))
a = Series([np.nan, 1., 2., 3., np.nan], index=np.arange(5))
b = Series([np.nan, 1, np.nan, 3, np.nan, 4.], index=np.arange(6))

result = op(a, b)
exp = equiv_op(a, b)
Expand Down
0