<jupyter_start><jupyter_text>Part 3: Implementing Inner-Join on the BSE Stock Dataset and Setiment Dataset NOTE: If you want to directly skip to part 4: Modelling building and Evaluation please skip to the 3rd Notebook.All the stock data found in this project has been directly retreived from finance.yahoo.com Please make sure you clone the entire library and all the path variables are rectified to avoid errors. Walkthrough: 1. Importing the libraries, and reading the dataset(.csv):Importing the pandas and numpy library. Scikit-learn is not required in this part of the series.    3. Correcting the data type for the date values:It is important to convert the dates to a datetime variable and normalize it to 00:00:00 UTC to keep things simple and free from complications. This can be done using the to_datetime function in Pandas. 3. Merging the two datasets using Inner JoinFor more inofrmation on inner join, please visit: https://www.w3schools.com/sql/sql_join_inner.asp 4. Exporting:The final section in this notebook involves exporting our data after we have sorted them according to the increasing order of our dates.<jupyter_code>import os
import numpy as np
import pandas as pd

df1 = pd.read_csv("price_data.csv")
df2 = pd.read_csv("news_data_sentiments.csv")
df1 
df2
df1.info()
df2.info()
df1["datetime"] = pd.to_datetime(df1["datetime"])
df1.info()
df2["datetime"] = pd.to_datetime(df2["datetime"])
df2.info()
df1
df2
df3 = df1.set_index("datetime")
df4 = df2.set_index("datetime")
df3
df4
df5 = pd.merge(df1, df2, on = "datetime", how = "inner") 
df_final = df5.drop(["headline"], axis = 1)
df_final
result = df_final.to_csv("price_data.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08279124778237729, 'fraction_numerical': 0.023063276167947958, 'mean_word_length': 5.220588235294118, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '404699', 'license': 'MIT', 'n_tokens_mistral': 531, 'n_tokens_neox': 510, 'n_words': 215, 'path': 'Part03-join-price-sentiment-data.ipynb', 'repo_name': 'arifwaqas/stock-market-prediction-grid', 'size': '1691'}