|
27 | 27 | # noinspection PyAttributeOutsideInit |
28 | 28 | class Nse: |
29 | 29 | version: str = '5.3' |
30 | | - beta: Tuple[bool, int] = (True, 2) |
| 30 | + beta: Tuple[bool, int] = (True, 3) |
31 | 31 |
|
32 | 32 | def __init__(self, window: Tk) -> None: |
33 | 33 | self.intervals: List[int] = [1, 2, 3, 5, 10, 15] |
@@ -1077,19 +1077,18 @@ def get_dataframe(self) -> Optional[Tuple[pandas.DataFrame, str, float]]: |
1077 | 1077 | df = df.transpose() |
1078 | 1078 |
|
1079 | 1079 | ce_values: List[dict] = [data['CE'] for data in json_data['records']['data'] if |
1080 | | - "CE" in data and str(data['expiryDate'].lower() == str(self.expiry_date).lower())] |
| 1080 | + "CE" in data and str(data['expiryDate']).lower() == str(self.expiry_date).lower()] |
1081 | 1081 | pe_values: List[dict] = [data['PE'] for data in json_data['records']['data'] if |
1082 | | - "PE" in data and str(data['expiryDate'].lower() == str(self.expiry_date).lower())] |
| 1082 | + "PE" in data and str(data['expiryDate']).lower() == str(self.expiry_date).lower()] |
1083 | 1083 | points: float = pe_values[0]['underlyingValue'] |
1084 | 1084 | if points == 0: |
1085 | 1085 | for item in pe_values: |
1086 | 1086 | if item['underlyingValue'] != 0: |
1087 | 1087 | points = item['underlyingValue'] |
1088 | 1088 | break |
1089 | | - ce_data: pandas.DataFrame = pandas.DataFrame(ce_values) |
1090 | | - pe_data: pandas.DataFrame = pandas.DataFrame(pe_values) |
1091 | | - ce_data_f: pandas.DataFrame = ce_data.loc[ce_data['expiryDate'] == self.expiry_date] |
1092 | | - pe_data_f: pandas.DataFrame = pe_data.loc[pe_data['expiryDate'] == self.expiry_date] |
| 1089 | + ce_data_f: pandas.DataFrame = pandas.DataFrame(ce_values) |
| 1090 | + pe_data_f: pandas.DataFrame = pandas.DataFrame(pe_values) |
| 1091 | + |
1093 | 1092 | if ce_data_f.empty: |
1094 | 1093 | messagebox.showerror(title="Error", |
1095 | 1094 | message="Invalid Expiry Date.\nPlease restart and enter a new Expiry Date.") |
|
0 commit comments