Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No "from_csv" method in pandas

When I try to use from_csv method in python 3.7, I receive attribution error:

import pandas as pd
pd.DataFrame.from_csv(adr)

AttributeError: type object 'DataFrame' has no attribute 'from_csv'

How can I solve this problem?

like image 925
amiref Avatar asked Aug 01 '19 16:08

amiref


2 Answers

from_csv is deprecated now. There are no further developments on this. Its suggested to use pd.read_csv now.

import pandas as pd
df = pd.read_csv("your-file-path-here")

And python warning now says the same -

main:1: FutureWarning: from_csv is deprecated. Please use read_csv(...) instead. Note that some of the default arguments are different, so please refer to the documentation for from_csv when changing your function calls

like image 71
d3c3pTi0n16 Avatar answered Sep 30 '22 21:09

d3c3pTi0n16


import pandas as pd

df = pd.read_csv('<CSV_FILE>')
like image 29
bcosta12 Avatar answered Sep 30 '22 21:09

bcosta12