For a head-like function you can just slice the array using dataset[:10]
.
For a tail-like function you can just slice the array using dataset[-10:]
.
Related Contents:
- Most efficient way to reverse a numpy array
- Python find elements in one list that are not in the other [duplicate]
- How do I catch a numpy warning like it’s an exception (not just for testing)?
- numpy max vs amax vs maximum
- Is it possible to use argsort in descending order?
- A tool to convert MATLAB code to Python [closed]
- What is dtype(‘O’), in pandas?
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- best way to preserve numpy arrays on disk
- FutureWarning: elementwise comparison failed; returning scalar, but in the future will perform elementwise comparison
- How to get the index of a maximum element in a NumPy array along one axis
- python numpy machine epsilon
- How to determine whether a column/variable is numeric or not in Pandas/NumPy?
- Replacing Numpy elements if condition is met
- Mean Squared Error in Numpy?
- Replace negative values in an numpy array
- How does python numpy.where() work?
- How to get correlation of two vectors in python [duplicate]
- AttributeError: ‘Tensor’ object has no attribute ‘numpy’
- Averaging over every n elements of a numpy array
- Why are NumPy arrays so fast?
- Why are 0d arrays in Numpy not considered scalar?
- How can numpy be so much faster than my Fortran routine?
- How to calculate the sum of all columns of a 2D numpy array (efficiently)
- Easy way to test if each element in an numpy array lies between two values?
- How to convert a python numpy array to an RGB image with Opencv 2.4?
- Performant cartesian product (CROSS JOIN) with pandas
- How to filter numpy array by list of indices?
- numpy.sin function in degrees?
- RuntimeWarning: divide by zero encountered in log
- How to update matplotlib’s imshow() window interactively?
- Weird behaviour initializing a numpy array of string data
- Compiling numpy with OpenBLAS integration
- how to extract frequency associated with fft values in python
- output of numpy.where(condition) is not an array, but a tuple of arrays: why?
- How does the axis parameter from NumPy work?
- Indexing a numpy array with a list of tuples
- Calculate the Cumulative Distribution Function (CDF) in Python
- Copy numpy array into part of another array
- How to increase Jupyter notebook Memory limit?
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester’
- Efficient creation of numpy arrays from list comprehension and in general
- `Sudo pip install matplotlib` fails to find freetype headers. [OS X Mavericks / 10.9] [closed]
- Numpy Vector (N,1) dimension -> (N,) dimension conversion
- numpy unique without sort [duplicate]
- Plotting power spectrum in python
- Pandas groupby with categories with redundant nan
- How do I transform a “SciPy sparse matrix” to a “NumPy matrix”?
- Pythonic way to create a numpy array from a list of numpy arrays
- How do I subtract the previous row from the current row in a pandas dataframe and apply it to every row; without using a loop?