Unable to run pandas


#1

Hi,

I tried several times and did some research on stackoverflow as well but I was unable run any pandas api. However pandas and pandasql got imported successfully. Please help.

@Shivangi952 its not about “.csv” I tried everything. The problem is something related to permissions. Pycharm is unable to recognize “read_csv” as an instance of pandas.

@s23711 Its not just about reading the file. I am unable to perform any of the pandas or pandasql operations.


#2

Since you mentioned packages are successfully installed, Can you please paste the screenshot what error you are getting?


#3

I found one mistake that you haven’t mentioned the file.

Say the file name is “name.csv”

Then you should write:

pd.read_csv(“C:\Users\Bansal\Desktop\Classes\DataMining\Projects\RedHat\people\name.csv”)

And I you may find following stackoverflow post useful(Couple of useful tips over there):

https://stackoverflow.com/questions/22872952/set-file-path-for-to-csv-in-pandas

Hope it helps a bit.


#4

Hi,
If your intention is to read all files inside the folder ‘people’ then you can use glob

import glob
l = [pd.read_csv(filename) for filename in glob.glob(“C:\Users\Bansal\Desktop\Classes\DataMining\Projects\RedHar\People/*”)] ==> Note : Last one is a back slash

I was trying to read all files inside a folder and come across this useful api

Sumit


#5

@kbansal7. Do you have all packages installed in pycharm? Its working for me. I have following packages -