foundations-for-analytics-with-python's Issues
Script still splits final two rows on comma within dollar values
Hello. I hope this is the correct place to provide feedback. In the exercise Read and Write a CSV file (Part 2) the script in the book still splits the final two dollar amounts in the supplier data that contain a comma to indicate thousands. I've re-typed the script from the book, run it from your supplied scripts from the book repository and run it a third time from the current script on the site and continue to receive the same error. The cost data is split across two columns, pushing date into a sixth and seventh column. Is there a subtlety I've missed?
Thanks,
Jay
10output.csv is missing
10output.csv is missing in Chapter 2.
ValueError: time data '1/20/14' does not match format '%m/%d/%Y'
Hello:
when I run(win8.1 64bit, Spyder 3.2.4, MySQL 5.7.20):
E:>python 4db_mysql_load_from_csv.py supplier_data.csv
it said: "ValueError: time data '1/20/14' does not match format '%m/%d/%Y'", but I changed "str(row[column_index]), '%m/%d/%Y'))" into "str('1/20/2015'), '%m/%d/%Y')) ", it can run , and the result is 👍
+---------------+----------------+-------------+------+---------------+
| Supplier_Name | Invoice_Number | Part_Number | Cost | Purchase_Date |
+---------------+----------------+-------------+------+---------------+
| Supplier X | 001-1001 | 2341 | 500 | 2015-01-20 |
| Supplier X | 001-1001 | 2341 | 500 | 2015-01-20 |
| Supplier X | 001-1001 | 5467 | 750 | 2015-01-20 |
| Supplier X | 001-1001 | 5467 | 750 | 2015-01-20 |
| Supplier Y | 50-9501 | 7009 | 250 | 2015-01-20 |
| Supplier Y | 50-9501 | 7009 | 250 | 2015-01-20 |
| Supplier Y | 50-9505 | 6650 | 125 | 2015-01-20 |
| Supplier Y | 50-9505 | 6650 | 125 | 2015-01-20 |
| Supplier Z | 920-4803 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4804 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4805 | 3321 | 615 | 2015-01-20 |
| Supplier Z | 920-4806 | 3321 | 615 | 2015-01-20 |
+---------------+----------------+-------------+------+---------------+
what's the matter? thanks.
sd
pandas_sum_average_multiple_workbooks.py
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
Book's Mistake
it's may some mistake In the page 99 of book .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.