Print X_train shape. What do you see? I’d bet X_train
is 2d (matrix with a single column), while y_train
1d (vector). In turn you get different sizes.
I think using X_train[:,0]
for plotting (which is from where the error originates) should solve the problem
Related Posts:
- ImportError: DLL load failed: The specified module could not be found
- ImportError: DLL load failed: The specified module could not be found
- Plotting a 2D heatmap with Matplotlib
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- TypeError: ‘DataFrame’ object is not callable
- load csv into 2D matrix with numpy for plotting
- Dump a NumPy array into a csv file
- Overcome ValueError for empty array
- What is the difference between np.mean and tf.reduce_mean?
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- Linear regression with matplotlib / numpy
- Matplotlib: TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
- How to plot an array in python?
- IndexError: index 2 is out of bounds for axis 0 with size 2
- How to implement the ReLU function in Numpy
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- Showing an image with pylab.imshow()
- Writing a pandas DataFrame to CSV file
- How do you change the size of figures drawn with Matplotlib?
- How to fix ‘Object arrays cannot be loaded when allow_pickle=False’ for imdb.load_data() function?
- ValueError: Unknown label type: ‘continuous’
- ImportError: No module named matplotlib.pyplot
- TypeError: unhashable type: ‘numpy.ndarray’
- IndexError: too many indices for array
- data type not understood
- What does numpy.random.seed(0) do?
- What does the c underscore expression `c_` do exactly?
- ImportError: Missing required dependencies [‘numpy’]
- Error: all the input array dimensions except for the concatenation axis must match exactly
- Expected 2D array, got 1D array instead error
- Pandas: ValueError: cannot convert float NaN to integer
- How to find all occurrences of an element in a list
- TypeError: ‘numpy.float64’ object is not callable
- TypeError: ‘numpy.float64’ object is not callable
- Convert a tensor to numpy array in Tensorflow?
- What’s the difference between torch.stack() and torch.cat() functions?
- ‘DataFrame’ object has no attribute ‘sort’
- How to change the font size on a matplotlib plot
- filename.whl is not a supported wheel on this platform
- TypeError: ‘numpy.float64’ object is not callable?
- Cross Entropy in PyTorch
- Convert a tensor to numpy array in Tensorflow?
- How to normalize a NumPy array to a unit vector?
- Python – Reading and writing csv files with utf-8 encoding
- How to customize a scatter matrix to see all titles?
- What is dtype(‘O’), in pandas?
- How can I upgrade NumPy?
- How can the Euclidean distance be calculated with NumPy?
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- Matplotlib automatic legend outside plot
- Add Legend to Seaborn point plot
- What is dtype(‘O’), in pandas?
- ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
- Overflow Error in Python’s numpy.exp function
- ValueError: ‘object too deep for desired array’
- Purpose of `numpy.log1p( )`?
- What does axis in pandas mean?
- How to take column-slices of dataframe in pandas
- Pytorch tensor to numpy array
- ‘numpy.float64’ object is not iterable
- Normalize data in pandas
- Can’t broadcast input array from shape (3,1) into shape (3,)
- deleting rows in numpy array
- How to make a 3D scatter plot in matplotlib
- How to draw vertical lines on a given plot in matplotlib
- Changing the “tick frequency” on x or y axis in matplotlib
- How to normalize a 2-dimensional numpy array in python less verbose?
- Remove xticks in a matplotlib plot?
- ValueError: cannot index with vector containing NA / NaN values
- (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape
- How can I remove Nan from list Python/NumPy
- How do I change the figure size with subplots?
- Saving a Numpy array as an image
- NumPy List Comprehension Syntax
- append new row to old csv file python
- Numpy extract submatrix
- Using numpy to build an array of all combinations of two arrays
- Can’t update to numpy 1.13 with anaconda?
- How to put the legend out of the plot
- TypeError: only integer arrays with one element can be converted to an index 3
- Numpy, multiply array with scalar
- Python 3: Multiply a vector by a matrix without NumPy
- How to add a new row to an empty numpy array
- Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python
- Numpy – add row to array
- plot a circle with pyplot
- Is there any numpy group by function?
- Mean Squared Error in Numpy?
- Is there a head and tail method for Numpy array?
- Difference between data type ‘datetime64[ns]’ and ‘
- Merging two DataFrames
- CSV new-line character seen in unquoted field error
- Transposing a 1D NumPy array
- numpy.float64 object is not iterable…but I’m NOT trying to
- vectorize conditional assignment in pandas dataframe
- Python OpenCV2 (cv2) wrapper to get image size?
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- alueError: ordinal must be >= 1