python-spark-tutorial's People
Forkers
naveen467 liu-peiwen alokd33 mohjei zorro1992 keyfun vardhan0707 thainguyentran rathorerijhu rubenmartin gachet kunlqt gtesei helenypan spdcoder yumsuresht newtech43 harunpehlivan marianacendon karthikporwal7 moisessalazar77 hgottipati youyou1205 iamuberman surenius santhoshchn junaidmh mallik-g pakinja hazelgithub tappoz aniamin tiravata rhysmeister nishantsgs thaiandinh2013 prybintsev shivang98 rahulkrishnanfs huibaobao venkat-ravilla karuncs sabya1981 arvindve osfp-pakistan satyamnijam japp54 anilpearl vuday7 kvasagiri harinarayan zsfarkas hayano1 ashishchandan namanmittal 09mca33 riyazhusain sunshinelala1991 manuhortet priyeshagrawal1992 janaidu01 skumarmn sirbr madhav95011 mudugalj jiahuihan venkatram64 shr264 pstiger evross gopinath678 mahongmsncom ashwini122 bettercourses learning-sources shankarpd bigbearstar vijayathota mraju1231 dd-david achalbi basic-belic abanerjee-wsu jgonda rima-b saivarun2185 swatishaswat fahimep arif-ibrahim pandiankavi36 corneliouzbett danieledu shafaypro patropavan aadiparimi afcarl moongj angel-asensio ocrrss alexgamecpython-spark-tutorial's Issues
The script WordCount.py in the rdd directory has a couple of issues
I am running these scripts on Debian Stretch.
Path issues
I had to import os
, then add this:
projRootPath = os.path.dirname(os.path.realpath(__file__)) + "/../"
lines = sc.textFile(projRootPath + "in/word_count.text")
Otherwise I am unable to run the script from different points in the file system.
Python version
It does not work on python 2. To make it work I had to use this environment variable:
export PYSPARK_PYTHON=python3
This information could be added to a README file.
I can provide a PR in case.
No examples on integrating pandas
These tutorials could be improved with some tips/examples/workarounds on how to integrate python code from data scientists that are used to libraries like pandas and numpy. There is no example on how to include 3rd party libraries (from pip, conda etc.) into PySpark (a Java based environment) and how to make the 2 different APIs work together.
No ansible/vagrant files for local development on a dedicated Virtual Machine
An Ansible script to provision a Vagrantfile
could be provided, so a dedicated Vagrant VM (Virtual Machine) could be bootstrapped for local development.
I can submit a PR if needed.
dashes in word_count.txt cause errors with WordCount.py
Issue:
Thendash
characters in word_count.txt
cause an error when following the "Run your first Spark Job" tutorial. There are only two occurences of this character here: "from 1913–74.
" and here: "near–bankruptcy
".
To Recreate:
using spark-2.3.2-bin-hadoop2.7
on Ubuntu18, pyspark/python 2.7, Installed following instructions from lecture 5, go to directory where you cloned python-spark-tutorial
and run the following from lecture 6:
spark-submit ./rdd/WordCount.py
The execution halts about halfway through the frequency counter with the following error:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position4: ordinal not in range(128)
Spoiler, it's the dash. I'm not sure whether or not the utf16 dash was intentional, so I'm posting.
Work-Around:
I changed the two ndash
characters to "from 1913-74.
" and "near-bankruptcy
", which solved the issue for me. Related stackoverflow thread where someone else ran into a similar problem with python2.7 and used the same solution.
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.