You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
TTP_CWE_mappingDF=pd.read_csv('./658.csv', sep=',')
columns_list=TTP_CWE_mappingDF.columns.tolist() # Returns column names as a listprint(columns_list)
print("\n")
TEST=TTP_CWE_mappingDF.iloc[:, [0]]
columns_list2=TEST.columns.tolist() # Returns column names as a listprint(columns_list2)
print(TEST)
# first_column = TTP_CWE_mappingDF.iloc[:, 0] # All rows (:) + first column (0)# print(first_column)
Issue Description
Hi,
When downloading the MITRE CAPEC cwe .csv I tried to import it on Python to play with it a bit.
Surprisingly, when selecting the first column, the data is from the second column, and this applies to the whole dataframe; all columns are off by one. The key is correct, but the data is for the next key.
["'ID"]
'ID
1 Accessing Functionality Not Properly Constrain...
11 Cause Web Server Misclassification
112 Brute Force
114 Authentication Abuse
115 Authentication Bypass
.. ...
698 Install Malicious Extension
70 Try Common or Default Usernames and Passwords
700 Network Boundary Bridging
94 Adversary in the Middle (AiTM)
98 Phishing
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Hi,
When downloading the MITRE CAPEC cwe .csv I tried to import it on Python to play with it a bit.
Surprisingly, when selecting the first column, the data is from the second column, and this applies to the whole dataframe; all columns are off by one. The key is correct, but the data is for the next key.
This is rather problematic, as you can imagine.
I added the .csv file I am using as well.
658.csv
Expected Behavior
this is the result i get:
["'ID", 'Name', 'Abstraction', 'Status', 'Description', 'Alternate Terms', 'Likelihood Of Attack', 'Typical Severity', 'Related Attack Patterns', 'Execution Flow', 'Prerequisites', 'Skills Required', 'Resources Required', 'Indicators', 'Consequences', 'Mitigations', 'Example Instances', 'Related Weaknesses', 'Taxonomy Mappings', 'Notes']
["'ID"]
'ID
1 Accessing Functionality Not Properly Constrain...
11 Cause Web Server Misclassification
112 Brute Force
114 Authentication Abuse
115 Authentication Bypass
.. ...
698 Install Malicious Extension
70 Try Common or Default Usernames and Passwords
700 Network Boundary Bridging
94 Adversary in the Middle (AiTM)
98 Phishing
[177 rows x 1 columns]
the expected result should be:
["'ID", 'Name', 'Abstraction', 'Status', 'Description', 'Alternate Terms', 'Likelihood Of Attack', 'Typical Severity', 'Related Attack Patterns', 'Execution Flow', 'Prerequisites', 'Skills Required', 'Resources Required', 'Indicators', 'Consequences', 'Mitigations', 'Example Instances', 'Related Weaknesses', 'Taxonomy Mappings', 'Notes']
["'ID"]
'ID
1
11
112
114
115
..
698
70
700
94
98
[177 rows x 1 columns]
Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.12.7
python-bits : 64
OS : Linux
OS-release : 6.8.11-arm64
Version : #1 SMP Kali 6.8.11-1kali2 (2024-05-30)
machine : aarch64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : C.UTF-8
pandas : 2.2.3
numpy : 2.2.4
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 24.1.1
Cython : None
sphinx : None
IPython : 9.0.2
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2025.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: