Python Pandas

2020-08-21 Thread J Conrado
HI, I'm using Pandas to read my .xls file and I used the command to read it: df = pd.read_excel(filexcel, parse_dates=[0], dayfirst=True) and I had the day, month, year and hour correctly But, if I  run the same script inside a virtual environment, I had this error message:   File "xlst

Re: Python Pandas split Date in day month year and hour

2020-08-19 Thread Tim Williams
On Wed, Aug 19, 2020 at 1:43 PM J Conrado wrote: > > > Hi, > > > I'm satarting using Pandas to read excel. I have a meteorological > synoptic data and I have for date: > > > 0 2017-11-01 00:00:00 > 1 2017-11-01 03:00:00 > 2 2017-11-01 06:00:00 > 3 2017-11-01 09:00:00 > 4 2017-11-01 12:0

RE: Python Pandas split Date in day month year and hour

2020-08-19 Thread Steve
what you want? FootNote: If money does not grow on trees, then why do banks have branches? -Original Message- From: Python-list On Behalf Of Brian Oney via Python-list Sent: Wednesday, August 19, 2020 2:01 PM To: python-list@python.org Subject: Re: Python Pandas split Date in day month

Re: Python Pandas split Date in day month year and hour

2020-08-19 Thread Skip Montanaro
> I would like know how can I get for this array the values for day, month > and hour: > > 2017-11-01 03:00:00 year = 2017 month = 11day = 1and > hour = 3 Pandas has a datetime type. You should probably be using it. It's been awhile (a year at least), but if your datetime co

Re: Python Pandas split Date in day month year and hour

2020-08-19 Thread Brian Oney via Python-list
On August 19, 2020 7:32:45 PM GMT+02:00, J Conrado wrote: > > >Hi, > > >I'm satarting using Pandas to read excel. I have a meteorological >synoptic data and I have for date: > > >0   2017-11-01 00:00:00 >1   2017-11-01 03:00:00 >2   2017-11-01 06:00:00 >3   2017-11-01 09:00:00 >4   2017-11-01

Python Pandas split Date in day month year and hour

2020-08-19 Thread J Conrado
Hi, I'm satarting using Pandas to read excel. I have a meteorological synoptic data and I have for date: 0   2017-11-01 00:00:00 1   2017-11-01 03:00:00 2   2017-11-01 06:00:00 3   2017-11-01 09:00:00 4   2017-11-01 12:00:00 ..  ... 229 2017-11-30 09:00:00 230 2017-11-30 12

Re: Python pandas Excel

2020-07-18 Thread Peter Otten
J Conrado wrote: > > > > > > > > > > > > HI, > > > I have an excel file with several columns, the first day/month,/year and > hour: > > > Data > 01/11/2017 00:00 > 01/11/2017 03:00 > 01/11/2017 06:00 > 01/11/2017 09:00 > 01/11/2017 12:00 > 01/11/2017 15:00 > 01/11/2017 18:00 > 01/11

Re: Python pandas Excel

2020-07-17 Thread dn via Python-list
On 18/07/20 11:06 AM, Dennis Lee Bieber wrote: On Sat, 18 Jul 2020 09:08:50 +1200, dn via Python-list declaimed the following: Assuming the import produces a string, are you able to "slice" the string into the requisite components? Given the OP's stated output -- I would suspect they

Re: Python pandas Excel

2020-07-17 Thread dn via Python-list
On 18/07/20 3:36 AM, J Conrado wrote: HI, I have an excel file with several columns, the first day/month,/year and hour: Data 01/11/2017 00:00 01/11/2017 03:00 ... Please, how can I get four arrays for day, month, year and hour this column of my excel. What do you have so-far? How are y

Python pandas Excel

2020-07-17 Thread J Conrado
HI, I have an excel file with several columns, the first day/month,/year and hour: Data 01/11/2017 00:00 01/11/2017 03:00 01/11/2017 06:00 01/11/2017 09:00 01/11/2017 12:00 01/11/2017 15:00 01/11/2017 18:00 01/11/2017 21:00 02/11/2017 00:00 02/11/2017 03:00 02/11/2017 06:00 02/11/

Re: python pandas convert strings to datetime problems

2016-04-11 Thread Peter Otten
Daiyue Weng wrote: > Hi, I need to compare the years in a Series. The values in the Series is > like '1996', '2015', '2006-01-02' or '20130101' etc. The code I created > is, > > col_value_series = pd.to_datetime(col_value_series, > infer_datetime_format=True) min_year = col_value_series.min().yea

python pandas convert strings to datetime problems

2016-04-11 Thread Daiyue Weng
Hi, I need to compare the years in a Series. The values in the Series is like '1996', '2015', '2006-01-02' or '20130101' etc. The code I created is, col_value_series = pd.to_datetime(col_value_series, infer_datetime_format=True) min_year = col_value_series.min().year max_year = col_value_series.ma

Re: Problems in python pandas

2014-09-17 Thread Mark Lawrence
On 16/09/2014 19:08, prashant.mud...@accenture.com wrote: Hi All, I am having some problem in python. I'm sorry that I can't help you directly but as you haven't had any answers this http://pandas.pydata.org/community.html states "Have a question about pandas? Your first stop should be Stac

Problems in python pandas

2014-09-16 Thread prashant.mudgal
Hi All, I am having some problem in python. I have written the code import pandas as pd import numpy as np from scipy.optimize import minimize pd.set_option('display.mpl_style', 'default') """Read the input file into the dataframe""" """T1 file contains the decision variables, corresponding inve

Re: Newbie problem with Python pandas

2013-01-06 Thread Roy Smith
In article <_dudntfyxdvclhtnnz2dnuvz_ocdn...@giganews.com>, RueTheDay wrote: > On Sun, 06 Jan 2013 11:45:34 -0500, Roy Smith wrote: > > > In article <_dudnttyxduonxtnnz2dnuvz_ocdn...@giganews.com>, > > RueTheDay wrote: > > > >> On Sun, 06 Jan 2013 08:05:59 -0800, Miki Tebeka wrote: > >> > >

Re: Newbie problem with Python pandas

2013-01-06 Thread RueTheDay
On Sun, 06 Jan 2013 11:45:34 -0500, Roy Smith wrote: > In article <_dudnttyxduonxtnnz2dnuvz_ocdn...@giganews.com>, > RueTheDay wrote: > >> On Sun, 06 Jan 2013 08:05:59 -0800, Miki Tebeka wrote: >> >> > On Sunday, January 6, 2013 5:57:17 AM UTC-8, RueTheDay wrote: >> >> I am getting the followi

Re: Newbie problem with Python pandas

2013-01-06 Thread Roy Smith
In article <_dudnttyxduonxtnnz2dnuvz_ocdn...@giganews.com>, RueTheDay wrote: > On Sun, 06 Jan 2013 08:05:59 -0800, Miki Tebeka wrote: > > > On Sunday, January 6, 2013 5:57:17 AM UTC-8, RueTheDay wrote: > >> I am getting the following error when running on Python 2.7 on Ubuntu > >> 12.04: > >> >

Re: Newbie problem with Python pandas

2013-01-06 Thread RueTheDay
On Sun, 06 Jan 2013 08:05:59 -0800, Miki Tebeka wrote: > On Sunday, January 6, 2013 5:57:17 AM UTC-8, RueTheDay wrote: >> I am getting the following error when running on Python 2.7 on Ubuntu >> 12.04: >> >> >> >> >> AttributeError: 'Series' object has no attribute 'str' > I would *guess*

Re: Newbie problem with Python pandas

2013-01-06 Thread Miki Tebeka
On Sunday, January 6, 2013 5:57:17 AM UTC-8, RueTheDay wrote: > I am getting the following error when running on Python 2.7 on Ubuntu > 12.04: > >> > > AttributeError: 'Series' object has no attribute 'str' I would *guess* that you have an older version of pandas on your Linux machine. Try "p

Newbie problem with Python pandas

2013-01-06 Thread RueTheDay
I'm working my way through the examples in the O'Reilly book Python For Data Analysis and have encountered a snag. The following code is supposed to analyze some web server log data and produces aggregate counts by client operating system. ### import json # used to process json