Data · dataset · 2024
Histograms for ONGC - open, low, high and adjusted close
Listed in Teesside University Research Data Repository
The provided code performs data analysis and visualization on historical stock price data for the Oil and Natural Gas Corporation (ONGC) from a CSV file.
Description
The code utilizes the pandas library for data manipulation and matplotlib.pyplot for generating histograms to visualize the distribution of various price metrics. Loading Data: The code begins by importing the pandas library as pd and the matplotlib.pyplot library as plt.
The file path of the CSV file containing the ONGC stock price data is specified. The data is loaded into a DataFrame named df using the read_csv() function from pandas. Extracting Required Columns: The code extracts the required columns from the DataFrame, including 'Open', 'High', 'Low', 'Close', and 'Adj Close' prices, and assigns them to separate variables.
Read the rest (4 more)
Summary
Statistics: Summary statistics are computed for each extracted column using the describe() function, which provides metrics such as count, mean, standard deviation, minimum, 25th percentile, median, 75th percentile, and maximum values. Plotting Histograms: Histograms are created for each price metric ('Open', 'High', 'Low', 'Close', 'Adj Close') using the plt.hist() function. Each histogram is plotted in a separate subplot within a single figure using the plt.subplot() function.
The number of bins for each histogram is set to 20 to visualize the distribution of prices across different ranges. Titles and labels are added to each subplot to provide context to the plotted data. Displaying Plots: The plt.tight_layout() function adjusts the spacing between subplots to prevent overlapping.
Finally, the plt.show() function is called to display the histograms. Overall, the code efficiently analyzes the distribution of ONGC stock prices across different metrics and visualizes them using histograms, allowing for easy interpretation of the data's characteristics and patterns.
Links
Where it is published
- DOI doi.org/10.17632/nr7whvc92c.1 ↗
DOI / persistent id · from researchdata tees ac uk
Catalogue records · 1
- OAI-PMH record data.mendeley.com/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Adata… ↗
metadata API · from researchdata tees ac uk
Topics
- From keywords
- Earth & Environmental Science · Humanities
Provenance · 1 source records, 7 field assertions
| Source | Key | Last seen | Raw |
|---|---|---|---|
| Teesside University Research Data Repository | oai:data.mendeley.com/nr7whvc92c.1 | 15 h ago | JSON v1 |
| Field | Assertion | Extractor | Evidence |
|---|---|---|---|
| access_level | source · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | |
| concepts[field].local:field:earth-environmental | mapping · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | |
| concepts[field].local:field:humanities | mapping · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | |
| description | source · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | /metadata/dc/description |
| license | source · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | /metadata/dc/rights |
| publication_date | source · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | |
| title | source · researchdata tees ac uk | connector:researchdata_tees_ac_uk@1.0.0 | /metadata/dc/title |