Closed paivadanieljl closed 6 months ago
It's hard to figure out what the problem is since we don't have access to dados.dat
. Could you provide a minimal bug report? (see https://matthewrocklin.com/minimal-bug-reports)
It's hard to figure out what the problem is since we don't have access to
dados.dat
. Could you provide a minimal bug report? (see https://matthewrocklin.com/minimal-bug-reports)
Here is the link to download the file, from google drive, im not sure if the problem is with it though.
https://drive.google.com/file/d/1IujtTu9eUEOPpId9bfgMzGfVhRz0ZrUr/view?usp=sharing
I am sorry, maybe you misunderstood me but the file and code are too large, can you try to make a new file that still makes the same error but with less lines of code?
anyone can help me with this strange behavior?
This is the issue tracker for pandas. You should only be posting reports here if you believe there is an issue with pandas. If we were to allow anyone to ask for help with using pandas here, we would be overwhelmed with "issues", and that would interfer with the fixes, enhancements, and maintenance the contributors are trying to provide.
I would recommend posting your question to StackOverflow. Closing for now.
Sorry for the mistake, didnt know, anyway i fixed it, i didnt see that the data had one comment line, so thats it
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
The code is getting me an error which i cant fix. Every time i try to read my data on dados.dat the i get the following error:
KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in get_loc(self, key) 3652 try: -> 3653 return self._engine.get_loc(casted_key) 3654 except KeyError as err:
4 frames pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'Step Nr.'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in get_loc(self, key) 3653 return self._engine.get_loc(casted_key) 3654 except KeyError as err: -> 3655 raise KeyError(key) from err 3656 except TypeError: 3657 # If we have a listlike key, _check_indexing_error will raise
KeyError: 'Step Nr.'
This is very strange because i just cant find whats wrong with it, and the only solution was changing the "dados" on n = dados['Step Nr.'] to "data", and it works only with the file on my girlfriend's laptop (which is exactly the same one that our teacher gave to us), anyone can help me with this strange behavior?
Expected Behavior
This should read the data just fine and print out the graphs for them, which, as i mentioned above, worked, but only on her laptop
Edit: We are using Google Collab with Python 3, just as our teacher asked
Installed Versions