Converting this data to Pandas Dataframe
will work here:
import pandas as pd
data = """
Date,Open,High,Low,Close,Adj Close,Volume
2021-05-26,124.000000,127.879997,121.269997,126.739998,126.739998,5569000
2021-05-27,134.389999,146.800003,133.539993,142.610001,142.610001,21735600
2021-05-28,149.979996,154.399994,143.000000,145.419998,145.419998,16985000
2021-06-01,142.899994,143.360001,132.130005,135.190002,135.190002,8631500
2021-06-02,134.593994,151.360001,134.593994,149.740005,149.740005,9488200
2021-06-03,145.000000,149.639999,140.110001,143.059998,143.059998,4840900
"""
print("*"*50)
print("Data: ")
print(data)
df = pd.DataFrame([x.split(',') for x in data.split('\n')])
print("*"*50)
print("Pandas Dataframe: ")
print(df)
print("*"*50)
print("Particular Column: ")
print(df[4])
Output:
**************************************************
Data:
Date,Open,High,Low,Close,Adj Close,Volume
2021-05-26,124.000000,127.879997,121.269997,126.739998,126.739998,5569000
2021-05-27,134.389999,146.800003,133.539993,142.610001,142.610001,21735600
2021-05-28,149.979996,154.399994,143.000000,145.419998,145.419998,16985000
2021-06-01,142.899994,143.360001,132.130005,135.190002,135.190002,8631500
2021-06-02,134.593994,151.360001,134.593994,149.740005,149.740005,9488200
2021-06-03,145.000000,149.639999,140.110001,143.059998,143.059998,4840900
**************************************************
Pandas Dataframe:
0 1 2 ... 4 5 6
0 None None ... None None None
1 Date Open High ... Close Adj Close Volume
2 2021-05-26 124.000000 127.879997 ... 126.739998 126.739998 5569000
3 2021-05-27 134.389999 146.800003 ... 142.610001 142.610001 21735600
4 2021-05-28 149.979996 154.399994 ... 145.419998 145.419998 16985000
5 2021-06-01 142.899994 143.360001 ... 135.190002 135.190002 8631500
6 2021-06-02 134.593994 151.360001 ... 149.740005 149.740005 9488200
7 2021-06-03 145.000000 149.639999 ... 143.059998 143.059998 4840900
8 None None ... None None None
[9 rows x 7 columns]
**************************************************
Particular Column:
0 None
1 Close
2 126.739998
3 142.610001
4 145.419998
5 135.190002
6 149.740005
7 143.059998
8 None
Name: 4, dtype: object
>
Explore more on the pandas framework for various operations that you can perform on dataframe and extract your required data out of it in the way you wanted.