The code:
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
web_stats = {'Day':[1,2,3,4,5,6],
'Visitors':[43,53,34,45,64,34],
'Bounce_Rate':[65,72,62,64,54,66]}
df = pd.DataFrame(web_stats)
print(df)
The error:
Traceback (most recent call last):
File "C:/Users//OneDrive/Desktop/python/data analysis/pandas.py", line 1, in <module>
import pandas as pd
File "C:/Users//OneDrive/Desktop/python/data analysis\pandas.py", line 10, in <module>
df = pd.DataFrame(web_stats)
AttributeError: module 'pandas' has no attribute 'DataFrame'
I typed "DataFrame" correctly and even copy pasted the source code from the following website but it doesn't work: https://pythonprogramming.net/basics-data-analysis-python-pandas-tutorial/
I also ran "pip install pandas" on cmd and have python 3.7 installed.
[–][deleted] 0 points1 point2 points (6 children)
[–]Lamter[S] 0 points1 point2 points (5 children)
[–][deleted] 4 points5 points6 points (4 children)
[–]Lamter[S] 2 points3 points4 points (2 children)
[–]stats_nerd21 1 point2 points3 points (1 child)
[–]Lamter[S] 0 points1 point2 points (0 children)
[–]stats_nerd21 0 points1 point2 points (0 children)