-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on pandas module #432
Comments
Actually, I'm not able to reproduce this w/ Windows 10, python 3.10, and pandas 1.5.2. What version of pandas are you using? import pandas as pd
data = pd.read_csv("C:\\dev\\misc\\candel\\weather_data.csv")
print(data[data["day"] == "Monday"])
#* or
print(data[data.day == "Monday"]) weather_data.csv:
|
Hi @Almenon, I am facing issues while selecting multiple columns from a pandas DataFrame. Python: Pandas: MacOS Ventura: import eventlet
eventlet.monkey_patch()
import warnings
warnings.filterwarnings("ignore")
import pandas as pd
df = pd.DataFrame(data = {
"Name":["abc","pqr","xyz"],
"Number":[5,10,15],
"Location":["Delhi","Hyderabad","Pune"]})
df_name_loc = df[["Name","Number"]]
print(df_name_loc) Error: Traceback (most recent call last):
line 12, in <module>
File "/Users/heera/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/frame.py", line 3470, in __getitem__
data = self._take_with_is_copy(indexer, axis=1)
File "/Users/heera/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/generic.py", line 3628, in _take_with_is_copy
result = self.take(indices=indices, axis=axis)
File "/Users/heera/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/generic.py", line 3615, in take
new_data = self._mgr.take(
File "/Users/heera/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 865, in take
return self.reindex_indexer(
File "/Users/heera/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 676, in reindex_indexer
new_blocks = self._slice_take_blocks_ax0(
File "/Users/heera1/miniforge3/envs/tensorflow/lib/python3.9/site-packages/pandas/core/internals/managers.py", line 802, in _slice_take_blocks_ax0
max_len = max(len(mgr_locs), taker.max() + 1)
File "/Users/heera1/miniforge3/envs/tensorflow/lib/python3.9/site-packages/numpy/core/_methods.py", line 40, in _amax
return umr_maximum(a, axis, None, out, keepdims, initial, where)
[TypeError: int() argument must be a string, a bytes-like object or a number, not '_NoValueType'](https://www.google.com/search?q=python%20TypeError:%20int()%20argument%20must%20be%20a%20string,%20a%20bytes-like%20object%20or%20a%20number,%20not%20%27_NoValueType%27)
Print Output:
Variables:
[-](vscode-webview://01h9evatblku50u4vv2dtjdc9le0pl9pkvtis1ljo8ih0btn16qo/index.html?id=61682136-9660-4219-9fee-9e82f676e143&origin=266bb1b2-da66-4490-bbdf-12e52fcb57b6&swVersion=4&extensionId=almenon.arepl&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app#){
df: [-](vscode-webview://01h9evatblku50u4vv2dtjdc9le0pl9pkvtis1ljo8ih0btn16qo/index.html?id=61682136-9660-4219-9fee-9e82f676e143&origin=266bb1b2-da66-4490-bbdf-12e52fcb57b6&swVersion=4&extensionId=almenon.arepl&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app#){
py/object: "pandas.core.frame.DataFrame",
values: "Name,Number,Location\nabc,5,Delhi\npqr,10,Hyderabad\nxyz,15,Pune\n",
txt: true,
meta: [+](vscode-webview://01h9evatblku50u4vv2dtjdc9le0pl9pkvtis1ljo8ih0btn16qo/index.html?id=61682136-9660-4219-9fee-9e82f676e143&origin=266bb1b2-da66-4490-bbdf-12e52fcb57b6&swVersion=4&extensionId=almenon.arepl&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app#){[2 items](vscode-webview://01h9evatblku50u4vv2dtjdc9le0pl9pkvtis1ljo8ih0btn16qo/index.html?id=61682136-9660-4219-9fee-9e82f676e143&origin=266bb1b2-da66-4490-bbdf-12e52fcb57b6&swVersion=4&extensionId=almenon.arepl&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app#)}
}
} |
I can print the result in the console without any error but AREPL reported many errors message.
The text was updated successfully, but these errors were encountered: