---
title: "Comment by fuubutsushi on \"Getting Mutual Funds Net Asset Value via Python using mftools API\" | Hashnode"
description: "Hi Shreyans Jain , Great work on the code. But getting an error while calling the function when executing the dataframe. Traceback (most recent call last): File"
url: "https://hashnode.com/posts/getting-mutual-funds-net-asset-value-via-python-using-mftools-api/609c0760e8590d4b4460ec46/comment/60d55b765ed303057acea368"
---

[Discussion](https://hashnode.com/posts/getting-mutual-funds-net-asset-value-via-python-using-mftools-api/609c0760e8590d4b4460ec46)

Comment [Getting Mutual Funds Net Asset Value via Python using mftools API](https://hashnode.com/posts/getting-mutual-funds-net-asset-value-via-python-using-mftools-api/609c0760e8590d4b4460ec46)

[fuubutsushi](https://hashnode.com/@fuubutsushi)

[Jun 25, 2021](https://hashnode.com/posts/getting-mutual-funds-net-asset-value-via-python-using-mftools-api/609c0760e8590d4b4460ec46/comment/60d55b765ed303057acea368)

Hi [Shreyans Jain](https://hashnode.com/@Shreyans),

Great work on the code. But getting an error while calling the function when executing the dataframe.

`Traceback (most recent call last):   File "C:/Users/am/Desktop/Python/Working/amfi.py", line 31, in <module>     values_df = HistoricalNav(scheme_code_list = scheme_code_list[0:5], start_date= '01-05-2021', end_date= '01-05-2021')   File "C:/Users/am/Desktop/Python/Working/amfi.py", line 22, in HistoricalNav     df = df.sort_values(by = 'date') # sorting the values of every Scheme code based on Date   File "C:\Users\am\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\frame.py", line 5455, in sort_values     k = self._get_label_or_level_values(by, axis=axis)   File "C:\Users\am\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 1684, in _get_label_or_level_values     raise KeyError(key) KeyError: 'date'`

Regards, Fuubutsushi

[Shreyans Jain](https://hashnode.com/@Shreyans)

[Jun 29, 2021](https://hashnode.com/posts/getting-mutual-funds-net-asset-value-via-python-using-mftools-api/609c0760e8590d4b4460ec46/comment/60d55b765ed303057acea368#reply-60dac6bd703d372ea06c980f)

Hi [fuubutsushi](https://hashnode.com/@fuubutsushi) Thanks for pointing out the error. The code has been modified to solve the issue. The article will be modified soon.

For easy reference, the Colab link is attached here as well - [bit.ly/3hjWDS8](https://bit.ly/3hjWDS8)
