0

Exception has occurred: ImportError dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/_imaging.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_xcb_connect' File "/Users/showrov/Desktop/Machine learning/Preprosessing/import_dataset.py", line 2, in <module> import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import pandas as pd

import numpy as np

import sys

print(sys.version)

data=pd.read_csv('Data_customer.csv')

print(data)

plt.plot(data[:2],data[:2])

2
  • 3
    You seem to have forgotten to add reproducible test data to your post. And you only show a very limited part of the error trace. Is line 2 the line with import pandas as pd? Did you install pandas? What version of matplotlib are you using? Do you have a local file called matplotlib.py? Commented Mar 26, 2022 at 15:43
  • 2
    Did you google the error? Did you try this yet? github.com/python-pillow/Pillow/issues/6015 Commented Mar 26, 2022 at 16:27

1 Answer 1

0

data[:2] will return the first 2 rows. In order to plot, you need to use the columns. Mention the column name directly like data['columnName'] otherwise use the iloc method. for example: data.iloc[:, 1:2] in order to access 2nd column. For more information about indexing operations, please check out this link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.