in Education by
when i want to execute below code and plot figer scatter_matrix(total_frame) total_frame is a dataframe like this the error like this: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_11336\1619863705.py in 1 total_frame.dropna(how='any') ----> 2 scatter_matrix(total_frame) 3 plt.show() ~\.conda\envs\env2\lib\site-packages\pandas\plotting\_misc.py in scatter_matrix(frame, alpha, figsize, ax, grid, diagonal, marker, density_kwds, hist_kwds, range_padding, **kwargs) 137 hist_kwds=hist_kwds, 138 range_padding=range_padding, --> 139 **kwargs, 140 ) 141 ~\.conda\envs\env2\lib\site-packages\pandas\plotting\_matplotlib\misc.py in scatter_matrix(frame, alpha, figsize, ax, grid, diagonal, marker, density_kwds, hist_kwds, range_padding, **kwds) 48 n = df.columns.size 49 naxes = n * n ---> 50 fig, axes = create_subplots(naxes=naxes, figsize=figsize, ax=ax, squeeze=False) 51 52 # no gaps between subplots ~\.conda\envs\env2\lib\site-packages\pandas\plotting\_matplotlib\tools.py in create_subplots(naxes, sharex, sharey, squeeze, subplot_kw, ax, layout, layout_type, **fig_kw) 265 266 # Create first subplot separately, so we can share it if requested --> 267 ax0 = fig.add_subplot(nrows, ncols, 1, **subplot_kw) 268 269 if sharex: ~\.conda\envs\env2\lib\site-packages\matplotlib\figure.py in add_subplot(self, *args, **kwargs) 770 projection_class, pkw = self._process_projection_requirements( 771 *args, **kwargs) --> 772 ax = subplot_class_factory(projection_class)(self, *args, **pkw) 773 key = (projection_class, pkw) 774 return self._add_axes_internal(ax, key) ~\.conda\envs\env2\lib\site-packages\matplotlib\axes\_subplots.py in __init__(self, fig, *args, **kwargs) 34 self._axes_class.__init__(self, fig, [0, 0, 1, 1], **kwargs) 35 # This will also update the axes position. ---> 36 self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args)) 37 38 @_api.deprecated( ~\.conda\envs\env2\lib\site-packages\matplotlib\gridspec.py in _from_subplot_args(figure, args) 595 f"{len(args)} were given") 596 --> 597 gs = GridSpec._check_gridspec_exists(figure, rows, cols) 598 if gs is None: 599 gs = GridSpec(rows, cols, figure=figure) ~\.conda\envs\env2\lib\site-packages\matplotlib\gridspec.py in _check_gridspec_exists(figure, nrows, ncols) 223 return gs 224 # else gridspec not found: --> 225 return GridSpec(nrows, ncols, figure=figure) 226 227 def __getitem__(self, key): ~\.conda\envs\env2\lib\site-packages\matplotlib\gridspec.py in __init__(self, nrows, ncols, figure, left, bottom, right, top, wspace, hspace, width_ratios, height_ratios) 385 super().__init__(nrows, ncols, 386 width_ratios=width_ratios, --> 387 height_ratios=height_ratios) 388 389 _AllowedKeys = ["left", "bottom", "right", "top", "wspace", "hspace"] ~\.conda\envs\env2\lib\site-packages\matplotlib\gridspec.py in __init__(self, nrows, ncols, height_ratios, width_ratios) 51 if not isinstance(ncols, Integral) or ncols <= 0: 52 raise ValueError( ---> 53 f"Number of columns must be a positive integer, not {ncols!r}") 54 self._nrows, self._ncols = nrows, ncols 55 self.set_height_ratios(height_ratios) ValueError: Number of columns must be a positive integer, not 0
i search such error and don't find anything,please help me!!!!! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
i have solved it, my data's class is object,the function need num, so i use pd.convert_dtypes() and it works

Related questions

0 votes
    def multiple_dfs(xyz_file, sheet, *args): row=2 writer = pd.ExcelWriter(xyz_file, engine='openpyxl') df = pd. ... help me over this? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I have the following df | 1 | 2 | 3 | ------------------------- 0.11 ... JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Working with census data, I want to replace NaNs in two columns ("workclass" and "native-country") with the ... way to do this? Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    I have a 20 x 4000 dataframe in python using pandas. Two of these columns are named Year and quarter. I'd ... anyone help with that? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I created a dataframe and column labels in pandas and I need to edit in order to replace the original column ... names. Please help? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Table1 where i get the data from a management script that calls a certain API. Table2 also gets data ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I'm working on this script that first takes all .csv's and converts them .xlsx's in a separate ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    I'm working on this script that first takes all .csv's and converts them .xlsx's in a separate ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    An irregular time series data is stored in a pandas.DataFrame. A DatetimeIndex has been set. I need the ... seemingly simple operation? Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    I am trying to groupby a column and compute value counts on another column. import pandas as pd dftest = pd. ... Amt, already exists Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I have a dataframe as below itm Date Amount 67 420 2012-09-30 00:00:00 65211 68 421 2012-09-09 00 ... solutions would be appreciated. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I'm starting with input data like this df1 = pandas.DataFrame( { "Name" : ["Alice", "Bob", "Mallory", ... Any hints would be welcome. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I'm trying to get the number of rows of dataframe df with Pandas, and here is my code. Method 1: total_rows ... What am I doing wrong? Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
0 votes
    How do I get the index column name in python pandas? Here's an example dataframe: Index Title Column 1 Apples 1 ... how to do this? Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
0 votes
    I have a dataset |category| cat a cat b cat a I'd like to be able to return something like (showing unique values ... cat a 2 cat b 1 Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
...