diff --git a/neo/core/analogsignal.py b/neo/core/analogsignal.py
index 8e129a52..aa971c80 100644
--- a/neo/core/analogsignal.py
+++ b/neo/core/analogsignal.py
@@ -285,11 +285,11 @@ class AnalogSignal(BaseNeo, pq.Quantity):
         Get the item or slice :attr:`i`.
         '''
         obj = super(AnalogSignal, self).__getitem__(i)
-        if isinstance(i, int):  # a single point in time across all channels
+        if isinstance(i, (int, np.integer)):  # a single point in time across all channels
             obj = pq.Quantity(obj.magnitude, units=obj.units)
         elif isinstance(i, tuple):
             j, k = i
-            if isinstance(j, int):  # extract a quantity array
+            if isinstance(j, (int, np.integer)):  # extract a quantity array
                 obj = pq.Quantity(obj.magnitude, units=obj.units)
             else:
                 if isinstance(j, slice):
@@ -303,7 +303,7 @@ class AnalogSignal(BaseNeo, pq.Quantity):
                     # in the general case, would need to return IrregularlySampledSignal(Array)
                 else:
                     raise TypeError("%s not supported" % type(j))
-                if isinstance(k, int):
+                if isinstance(k, (int, np.integer)):
                     obj = obj.reshape(-1, 1)
                 if self.channel_index:
                     obj.channel_index = self.channel_index.__getitem__(k)
diff --git a/neo/core/irregularlysampledsignal.py b/neo/core/irregularlysampledsignal.py
index b37034fc..045fb24a 100644
--- a/neo/core/irregularlysampledsignal.py
+++ b/neo/core/irregularlysampledsignal.py
@@ -225,11 +225,11 @@ class IrregularlySampledSignal(BaseNeo, pq.Quantity):
         Get the item or slice :attr:`i`.
         '''
         obj = super(IrregularlySampledSignal, self).__getitem__(i)
-        if isinstance(i, int):  # a single point in time across all channels
+        if isinstance(i, (int, np.integer)):  # a single point in time across all channels
             obj = pq.Quantity(obj.magnitude, units=obj.units)
         elif isinstance(i, tuple):
             j, k = i
-            if isinstance(j, int):  # a single point in time across some channels
+            if isinstance(j, (int, np.integer)):  # a single point in time across some channels
                 obj = pq.Quantity(obj.magnitude, units=obj.units)
             else:
                 if isinstance(j, slice):
@@ -238,7 +238,7 @@ class IrregularlySampledSignal(BaseNeo, pq.Quantity):
                     raise NotImplementedError("Arrays not yet supported")
                 else:
                     raise TypeError("%s not supported" % type(j))
-                if isinstance(k, int):
+                if isinstance(k, (int, np.integer)):
                     obj = obj.reshape(-1, 1)
         elif isinstance(i, slice):
             obj.times = self.times.__getitem__(i)

Slicing `AnalogSignal` with numpy.int64 gives an incorrect result
Example:
```python
>>> signal[:, 0].shape
(1000, 1)
>>> signal[:, np.int64(0)].shape
(1000,)
```

diff --git a/neo/test/coretest/test_analogsignal.py b/neo/test/coretest/test_analogsignal.py
index 0053e566..4b769fe3 100644
--- a/neo/test/coretest/test_analogsignal.py
+++ b/neo/test/coretest/test_analogsignal.py
@@ -313,28 +313,29 @@ class TestAnalogSignalArrayMethods(unittest.TestCase):
 
     def test__slice_should_return_AnalogSignalArray(self):
         # slice
-        result = self.signal1[3:8, 0]
-        self.assertIsInstance(result, AnalogSignal)
-        assert_neo_object_is_compliant(result)
-        self.assertEqual(result.name, 'spam')         # should slicing really preserve name and description?
-        self.assertEqual(result.description, 'eggs')  # perhaps these should be modified to indicate the slice?
-        self.assertEqual(result.file_origin, 'testfile.txt')
-        self.assertEqual(result.annotations, {'arg1': 'test'})
-
-        self.assertEqual(result.size, 5)
-        self.assertEqual(result.sampling_period, self.signal1.sampling_period)
-        self.assertEqual(result.sampling_rate, self.signal1.sampling_rate)
-        self.assertEqual(result.t_start,
-                         self.signal1.t_start+3*result.sampling_period)
-        self.assertEqual(result.t_stop,
-                         result.t_start + 5*result.sampling_period)
-        assert_array_equal(result.magnitude, self.data1[3:8].reshape(-1, 1))
-
-        # Test other attributes were copied over (in this case, defaults)
-        self.assertEqual(result.file_origin, self.signal1.file_origin)
-        self.assertEqual(result.name, self.signal1.name)
-        self.assertEqual(result.description, self.signal1.description)
-        self.assertEqual(result.annotations, self.signal1.annotations)
+        for index in (0, np.int64(0)):
+            result = self.signal1[3:8, index]
+            self.assertIsInstance(result, AnalogSignal)
+            assert_neo_object_is_compliant(result)
+            self.assertEqual(result.name, 'spam')         # should slicing really preserve name and description?
+            self.assertEqual(result.description, 'eggs')  # perhaps these should be modified to indicate the slice?
+            self.assertEqual(result.file_origin, 'testfile.txt')
+            self.assertEqual(result.annotations, {'arg1': 'test'})
+
+            self.assertEqual(result.size, 5)
+            self.assertEqual(result.sampling_period, self.signal1.sampling_period)
+            self.assertEqual(result.sampling_rate, self.signal1.sampling_rate)
+            self.assertEqual(result.t_start,
+                             self.signal1.t_start+3*result.sampling_period)
+            self.assertEqual(result.t_stop,
+                             result.t_start + 5*result.sampling_period)
+            assert_array_equal(result.magnitude, self.data1[3:8].reshape(-1, 1))
+
+            # Test other attributes were copied over (in this case, defaults)
+            self.assertEqual(result.file_origin, self.signal1.file_origin)
+            self.assertEqual(result.name, self.signal1.name)
+            self.assertEqual(result.description, self.signal1.description)
+            self.assertEqual(result.annotations, self.signal1.annotations)
 
     def test__slice_should_let_access_to_parents_objects(self):
         result =  self.signal1.time_slice(1*pq.ms,3*pq.ms)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/NeuralEnsemble/python-neo.git@9bd5f01a3b3dc311a89c0be3b0008e516fd3a098#egg=neo
nose==1.3.7
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
quantities==0.13.0
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: python-neo
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - quantities==0.13.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/python-neo

neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__slice_should_return_AnalogSignalArray
neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__add_quantity_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__add_two_consistent_signals_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalFunctions::test__pickle
neo/test/coretest/test_analogsignal.py::Test__generate_datasets::test__fake_neo__cascade neo/test/coretest/test_analogsignal.py::Test__generate_datasets::test__fake_neo__nocascade neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create2D_with_copy_false_should_return_view neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_from_array_no_units_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_from_list neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_from_np_array neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_from_quantities_array neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_from_quantities_array_inconsistent_units_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_inconsistent_sampling_rate_and_period_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_with_None_sampling_rate_should_raise_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_with_None_t_start_should_raise_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_with_additional_argument neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_with_copy_false_should_return_view neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_with_copy_true_should_return_copy neo/test/coretest/test_analogsignal.py::TestAnalogSignalConstructor::test__create_without_sampling_rate_or_period_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__compliant neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__duplicate_with_new_array neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__duration_getter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__repr neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_period_getter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_period_setter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_period_setter_None_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_period_setter_not_quantity_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_rate_getter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_rate_setter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_rate_setter_None_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__sampling_rate_setter_not_quantity_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__t_start_setter_None_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__t_stop_getter neo/test/coretest/test_analogsignal.py::TestAnalogSignalProperties::test__times_getter neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__comparison_with_inconsistent_units_should_raise_Exception neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__compliant neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__copy_should_let_access_to_parents_objects neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__getitem_out_of_bounds_IndexError neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__getitem_should_return_single_quantity neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__rescale_new neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__rescale_new_incompatible_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__rescale_same neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__simple_statistics neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__slice_should_change_sampling_period neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__slice_should_let_access_to_parents_objects neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test__slice_should_modify_linked_channelindex neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test_as_array neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test_as_quantity neo/test/coretest/test_analogsignal.py::TestAnalogSignalArrayMethods::test_comparison_operators neo/test/coretest/test_analogsignal.py::TestAnalogSignalEquality::test__signals_with_different_data_complement_should_be_not_equal neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__add_const_quantity_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__add_signals_with_inconsistent_data_complement_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__compliant neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__divide_by_const_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__mult_by_const_float_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__subtract_const_should_preserve_data_complement neo/test/coretest/test_analogsignal.py::TestAnalogSignalCombination::test__subtract_from_const_should_return_signal neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_array_rate_none_TypeError neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_none_rate_float_TypeError neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_none_rate_none_ValueError neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_none_rate_quant neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_quant_rate_none neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_rate_equivalent neo/test/coretest/test_analogsignal.py::TestAnalogSignalSampling::test___get_sampling_rate__period_rate_not_equivalent_ValueError
neo/core/irregularlysampledsignal.py neo/core/analogsignal.py
neo/core/irregularlysampledsignal.py neo/core/analogsignal.py