Pandas ImportError - python-3.x

Whenever I try to import pandas as pd it shows the error
ImportError: cannot import name 'window' from 'pandas.core' (//anaconda3/lib/python3.7/site-packages/pandas/core/__init__.py)

Related

Problem in importing : import pandas_market_calendars

After the installation of market calendar, when I import:
import pandas_market_calendars
I get following error:
ImportError: cannot import name 'apply_wraps' from 'pandas._libs.tslibs.offsets'
import pandas as pd
import pandas_market_calendars as mcal

ImportError: cannot import name 'StringIO'

I am trying to get data from yahoo of stocks of a company through the code.
But i am getting an ImportError at pandas_datareader.data where is says
ImportError: cannot import name 'StringIO'
Please help
I am new to this...and already spent 4 hrs but could not resolve.
I have even tried
import io
from io import StringIO
still getting the same error..!!
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
style.use('ggplot')
start = dt.datetime(2018,1,1)
end = dt.datetime(2018,12,31)
df = web.datareader('TSLA','yahoo',start,end)
print(df.head(5))
Error:-
Traceback (most recent call last):
File "C:\Users\JAILANCHAL\Desktop\tut.py", line 5, in <module>
import pandas_datareader.data as web
File "C:\Users\JAILANCHAL\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas_datareader\__init__.py", line 2, in <module>
from .data import (DataReader, Options, get_components_yahoo,
File "C:\Users\JAILANCHAL\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas_datareader\data.py", line 7, in <module>
from pandas_datareader.av.forex import AVForexReader
File "C:\Users\JAILANCHAL\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas_datareader\av\__init__.py", line 3, in <module>
from pandas_datareader.base import _BaseReader
File "C:\Users\JAILANCHAL\AppData\Local\Programs\Python\Python35\lib\site-packages\pandas_datareader\base.py", line 11, in <module>
from pandas.compat import StringIO, bytes_to_str
ImportError: cannot import name 'StringIO'

Facing 'list' object has no attribute 'find' error while parsing all docuemnts inside a collection

Hi I have a database name:Tmobile and it has a collection with two files Mynew and 30dc..
See image
Now i am trying to loop through the files and print any element /file from it.
Below is my code:
import pandas as pd
import json
from pandas.io.json import json_normalize
from unittest.mock import inplace
from pymongo import MongoClient
from idlelib.rpc import response_queue
from pandas import DataFrame
connection = MongoClient('localhost', 27017)
db=connection.Tmobile
collection=db.Collections
#print(collection)
for collection1 in collection.find():
print(collection1)
But when i try this i get the below error:
Traceback (most recent call last):
File "C:\Users\esrilka\eclipse-workspace\My First PyDev Project\dbsample.py", line 13, in <module>
['30dc6d110c7a0d3d371177ac0a3624bc_1', 'Mynew']
for collection in collection.find():
AttributeError: 'list' object has no attribute 'find'

Cannot from pandas import Dataframe

from pandas import Dataframe
ImportError Traceback (most recent call last)
in ()
----> 1 from pandas import Dataframe
ImportError: cannot import name 'Dataframe'
I understand there are workarounds but I need to do this for an assignment. I am using Jupiter Python ver 3.6.
Thsnks in Advance
from pandas import DataFrame
Notice capitalization

ImportError: cannot import name 'mutual_info_classif'

I want to do feature selection using K-Best and scoring function 'mutual_info_classif' in scikitlearn. However I am not able to import this function because of this error:
ImportError: cannot import name 'mutual_info_classif'

Resources