<jupyter_start><jupyter_text>The Finacne dataIn **this notebook** I´m going to explain:- Which indexes are there- Which one I´m going to use- Why I´m going to use this- How I´m getting the data**Timeframe** - Interest: 20.01.2017 - 09.02.2020**Timeframe** - Data: 01.01.2017 - 13.02.2020 **Why do I have to deciede which Index I´m going to use??** I´m going to program my system, so I can input any data!!!   Input output  Input:I´m going to use whatever index, I want to see the changes based on what index I´m interested in.But for the project there must be a limit, therefore I gonna take the indexes of three different [countries](https://money.cnn.com/data/world_markets/asia/):- [US](https://www.investopedia.com/insights/introduction-to-stock-market-indices/) (**Dow Jones, S&P 500, Nasdaq**)- China (**SSE Composite, Hang Seng**)- Germany (**DAX 30**)This the other two indexes could be interesting to look at, since Trump started a trade war and these are the countries he is punishing most. Therefore it could be interesting how other counties indexes are reactin on his tweets. **Project: Should define a specific index and the emotion we are looking for.**  Output:For the finance data the output is going to data frame, each index is going to have an own data frame. **BUT**, the output of the analytics should **not be just a table of up and down!!!****As the output of the project, I want to have distributions with the changes in the index.** **For specific emotions**Left the negative and to the right the positive changes of the index.  ProblemI just get the opening, high, low and close value. I thought I´m going to get the value of one specific minute/hour.I will get the other indexes as well with open, high, low, close values, but I have to consider how to change the thinking of the project... **Option 1:** aggregation(majority vote) of his emotion on specific day.**Option 2:** try to access via api the exact value of the stock **(don´t know if it´s possible, check this)**.  Option 1<jupyter_code># import needed libraries
import pandas as pd
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>US finance data<jupyter_code># show information function
def plot_index(data):
    plt.plot(data.Date, data.Close)
    plt.xlabel("Time")
    plt.ylabel("Index")
    plt.show()<jupyter_output><empty_output><jupyter_text>**[S&P 500](https://finance.yahoo.com/quote/%5EGSPC?p=^GSPC)**<jupyter_code>SP500 = pd.read_csv("S&P500.csv")
SP500.head(2)
SP500.tail(2)
plot_index(SP500)<jupyter_output><empty_output><jupyter_text>**[<NAME>](https://finance.yahoo.com/quote/%5EDJI/history?period1=1483228800&period2=1581552000&interval=1d&filter=history&frequency=1d)**<jupyter_code>DowJones = pd.read_csv("DowJones.csv")
DowJones.head(2)
DowJones.tail(2)
plot_index(DowJones)<jupyter_output><empty_output><jupyter_text>**[NASDAQ](https://finance.yahoo.com/quote/%5EIXIC/history?period1=1483228800&period2=1581552000&interval=1d&filter=history&frequency=1d)**<jupyter_code>NASDAQ = pd.read_csv("NASDAQ.csv")
NASDAQ.head(2)
NASDAQ.tail(2)
plot_index(NASDAQ)<jupyter_output><empty_output><jupyter_text>German finance data **[DAX](https://finance.yahoo.com/quote/DAX/history?p=DAX&.tsrc=fin-srch)**<jupyter_code>DAX = pd.read_csv("DAX.csv")
DAX.head(2)
DAX.tail(2)
plot_index(DAX)<jupyter_output><empty_output><jupyter_text>Chinas finance data **[SSE Composite](https://finance.yahoo.com/quote/000001.SS/history?p=000001.SS&.tsrc=fin-srch)**<jupyter_code>SSEComposite = pd.read_csv("SSEComposite.csv")
SSEComposite.head(2)
SSEComposite.tail(2)
plot_index(SSEComposite)<jupyter_output><empty_output><jupyter_text>**[<NAME>](https://finance.yahoo.com/quote/%5EHSI/history?period1=1483228800&period2=1581552000&interval=1d&filter=history&frequency=1d)**<jupyter_code>HSI = pd.read_csv("HANGSENGINDEX.csv")
HSI.head(2)
HSI.tail(2)
plot_index(HSI)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13114754098360656, 'fraction_numerical': 0.04047131147540984, 'mean_word_length': 6.367924528301887, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 8, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '598568', 'license': 'Apache-2.0', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1324, 'n_words': 368, 'path': 'Data/Fiance data/Get Finance Data.ipynb', 'repo_name': 'Philhoels/Emotions_and_StockMarkets', 'size': '3910'}