Skip to content
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

pandas_sum_average_multiple_workbooks.py #7

Open
Chengjingsilent opened this issue Jul 12, 2019 · 8 comments
Open

pandas_sum_average_multiple_workbooks.py #7

Chengjingsilent opened this issue Jul 12, 2019 · 8 comments

Comments

@Chengjingsilent
Copy link

I copied this code, but it couldn't run on my computer with showing:
Traceback (most recent call last):
File "pandas_sum_average_multiple_workbooks.py", line 32, in
worksheet_data_frames.append(pd.DataFrame(data, columns=['workbook', 'worksheet', 'worksheet_total', 'worksheet_average']))
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\frame.py", line 392, in init
mgr = init_dict(data, index, columns, dtype=dtype)
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 212, in init_dict
return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 56, in arrays_to_mgr
arrays = _homogenize(arrays, index, dtype)
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 277, in _homogenize
raise_cast_failure=False)
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 660, in sanitize_array
subarr = com.asarray_tuplesafe(data, dtype=dtype)
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\common.py", line 240, in asarray_tuplesafe
values = [tuple(x) for x in values]
File "D:\Applications\Anaconda\lib\site-packages\pandas\core\common.py", line 240, in
values = [tuple(x) for x in values]
TypeError: 'int' object is not iterable

@nardinmarcus
Copy link

hello world

@XinYunke6ke4
Copy link

I have the same question

@caoweiyi2580
Copy link

I have something wrong with the same line as well.
But the error is:
ValueError: Data must be 1-dimensional

@sian1989
Copy link

I have the same erorr as ValueError: Data must be 1-dimensional

@xiaohongguoer
Copy link

xiaohongguoer commented Dec 19, 2021 via email

@sian1989
Copy link

I copied this code, but it couldn't run on my computer with showing: Traceback (most recent call last): File "pandas_sum_average_multiple_workbooks.py", line 32, in worksheet_data_frames.append(pd.DataFrame(data, columns=['workbook', 'worksheet', 'worksheet_total', 'worksheet_average'])) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\frame.py", line 392, in init mgr = init_dict(data, index, columns, dtype=dtype) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 212, in init_dict return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 56, in arrays_to_mgr arrays = _homogenize(arrays, index, dtype) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 277, in _homogenize raise_cast_failure=False) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\internals\construction.py", line 660, in sanitize_array subarr = com.asarray_tuplesafe(data, dtype=dtype) File "D:\Applications\Anaconda\lib\site-packages\pandas\core\common.py", line 240, in asarray_tuplesafe values = [tuple(x) for x in values] File "D:\Applications\Anaconda\lib\site-packages\pandas\core\common.py", line 240, in values = [tuple(x) for x in values] TypeError: 'int' object is not iterable

Here are the correct one: https://blog.csdn.net/cici2013/article/details/86705172

@NNNightglow
Copy link

@xiaohongguoer
Copy link

xiaohongguoer commented Oct 4, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants