[Tutor] Creating a DataFrame from excel file
Naren
naren_sap at yahoo.com
Fri Feb 9 12:22:55 EST 2018
Creating a data frame from excel.
pd.read_csv(path, index_col=0,parse_dates=True).
example:
df = pd.read_csv('small_data/fha_by_tract.csv', names=names)
df.head()
Best Regards - Naren
> On Feb 9, 2018, at 9:00 AM, tutor-request at python.org wrote:
>
> Send Tutor mailing list submissions to
> tutor at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
> tutor-request at python.org
>
> You can reach the person managing the list at
> tutor-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
> Today's Topics:
>
> 1. Creating a DataFrame from excel file (Charlotte Hoff Sonne)
> 2. Re: Creating a DataFrame from excel file (Mark Lawrence)
>
> From: Charlotte Hoff Sonne <charlotte.sonne at hotmail.com>
> Subject: [Tutor] Creating a DataFrame from excel file
> Date: February 8, 2018 at 1:23:09 PM PST
> To: "tutor at python.org" <tutor at python.org>
>
>
> I wish to create a very large data frame with pandas. So far, I have learned how to create data frames by manually entering the values I want in my data frame. However, now I have a large dataset from excel that I want to get imported as a data frame in jupyter notebook. Initially i wrote the following code:
>
> pd.read_excel(“…”)
>
> But this is not a data frame, is it? Can I convert my excel file to a data frame?
>
>
> From: Mark Lawrence <breamoreboy at gmail.com>
> Subject: Re: [Tutor] Creating a DataFrame from excel file
> Date: February 9, 2018 at 8:35:15 AM PST
> To: tutor at python.org
>
>
> On 08/02/18 21:23, Charlotte Hoff Sonne wrote:
>> I wish to create a very large data frame with pandas. So far, I have learned how to create data frames by manually entering the values I want in my data frame. However, now I have a large dataset from excel that I want to get imported as a data frame in jupyter notebook. Initially i wrote the following code:
>> pd.read_excel(“…”)
>> But this is not a data frame, is it? Can I convert my excel file to a data frame?
>
> https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_excel.html states quite clearly "Read an Excel table into a pandas DataFrame" so you just have to assign the return value from the call to a variable.
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence
>
>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> https://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list