GithubHelp home page GithubHelp logo

llsourcell / twitter_sentiment_challenge Goto Github PK

View Code? Open in Web Editor NEW
107.0 8.0 128.0 2 KB

Twitter Sentiment Analysis Challenge for Learn Python for Data Science #2 by @Sirajology on Youtube

Python 100.00%

twitter_sentiment_challenge's Introduction

twitter_sentiment_challenge

Twitter Sentiment Analysis Challenge for Learn Python for Data Science #2 by @Sirajology on Youtube

##Overview

This is the code for the Twitter Sentiment Analyzer challenge for 'Learn Python for Data Science #2' by @Sirajology on YouTube. The code uses the tweepy library to access the Twitter API and the TextBlob library to perform Sentiment Analysis on each Tweet. We'll be able to see how positive or negative each tweet is about whatever topic we choose.

##Dependencies

Install missing dependencies using pip

##Usage

Once you have your dependencies installed via pip, run the script in terminal via

python demo.py

##Challenge

Instead of printing out each tweet, save each Tweet to a CSV file with an associated label. The label should be either 'Positive' or 'Negative'. You can define the sentiment polarity threshold yourself, whatever you think constitutes a tweet being positive/negative. Push your code repository to github then post it in the comments. I'll give the winner a shoutout a week from now!

##Credits

This code is 100% Siraj baby.

twitter_sentiment_challenge's People

Contributors

llsourcell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitter_sentiment_challenge's Issues

encoding

txt= open('txt.txt', 'w+', encoding="utf-8")

UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0

When i run QGIS for geocoding CVS with google, an error came out.

Does anyone can help me with this?

The full decription shown below:

"""An error has occurred while executing Python code:

UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to
Traceback (most recent call last):
File "C:/Users/Cheyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_dialogs.py", line 1199, in run
shapefilename, notfoundfile, fields, service, apikey, 1)
File "C:/Users/Cheyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\mmqgis\mmqgis_library.py", line 2005, in mmqgis_geocode_web_service
notwriter.writerow(header)
File "E:\OSGeo4W64\apps\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 0: character maps to

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version: 3.2.0-Bonn Bonn, bc43194061

Python Path:
E:/OSGeo4W64/apps/qgis/./python
C:/Users/Cheyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Cheyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
E:/OSGeo4W64/apps/qgis/./python/plugins
E:\OSGeo4W64\bin\python36.zip
E:\OSGeo4W64\apps\Python36\DLLs
E:\OSGeo4W64\apps\Python36\lib
E:\OSGeo4W64\bin
E:\OSGeo4W64\apps\Python36
E:\OSGeo4W64\apps\Python36\lib\site-packages
E:\OSGeo4W64\apps\Python36\lib\site-packages\h5py-2.7.0-py3.6-win-amd64.egg
E:\OSGeo4W64\apps\Python36\lib\site-packages\win32
E:\OSGeo4W64\apps\Python36\lib\site-packages\win32\lib
E:\OSGeo4W64\apps\Python36\lib\site-packages\Pythonwin
C:/Users/Cheyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\Cheyu\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms
"""

UnicodeEncodeError: 'charmap' codec can't encode character '\u2502' in

I got the error below while installing BROWNIE in Visual Studio Code on Windows;
Subprocess_post_check_handle_pip_error(pip_process)
line 349, in subprocess_post_check_handle_pip_error
print(completed_process.stderr, file=pip_error_fh, end="")
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2502' in position 559: character maps to

I did the following to get BROWNIE to work, may work for you;
-pip install openapi-codec
-python -m pipx ensurepath
-python -m pipx ensurepath --force
-pip install cython
-pip install cytoolz
-pip3 install --user eth-brownie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.