Hi Pratap,

They don't tolerate non-coders in stackoverflow :P

Thanks for sharing the script! Now can someone put it up online somewhere ;)

This one is presently beyond my scope of programming skills, but IMHO
falls within Datameet's mandate because a very large amount of the
data we want to work with does in fact get stored in different ways
that are friendly for human data entry but not directly
machine-readable. Most notably in a two-dimensional layout similar to
the weekly timetable most of us had in school.

One more lead :
https://shancarter.github.io/mr-data-converter/
I think the "XML-Nodes" output mode IS doing the job; one only has to
alter the output string formatting.




On 3/29/17, Pratap Vardhan <pratap...@gmail.com> wrote:
> Better suited for Stackoverflow. Here's a way to doing it in python.
>
> import pandas as pd
>
> df = pd.read_excel('Downloads/RF_Pashan.xls', 'Sheet4')
> # Subselect your data, since data irregularly formatted
> dff = df.ix[2:, 2:-5]
> # Rename column names
> dff.columns = ['Year', 'Month'] + range(1, 32)
> dff2 = dff.set_index(['Year', 'Month']).stack()
> # Final required format
> rain = pd.DataFrame({
>     'date': dff2.index.to_series().apply(lambda x: '{2:02.0f}-{1}-{0}'.
> format(*x)).values,
>     'rainfall': dff2.values})
> # Export to csv file
> rain.to_csv('rain.csv', index=False)
>
>
>          date rainfall
> 0  01-01-1999        0
> 1  02-01-1999        0
> 2  03-01-1999        0
> 3  04-01-1999        0
> 4  05-01-1999        0
>
>
> Regards,
> Pratap Vardhan
>
> --
> Datameet is a community of Data Science enthusiasts in India. Know more
> about us by visiting http://datameet.org
> ---
> You received this message because you are subscribed to the Google Groups
> "datameet" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to datameet+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
--
Cheers,
Nikhil
+91-966-583-1250
Pune, India
Self-designed learner at Swaraj University <http://www.swarajuniversity.org>
Blog <http://nikhilsheth.blogspot.in> | Contribute
<https://www.payumoney.com/webfronts/#/index/NikhilVJ>

-- 
Datameet is a community of Data Science enthusiasts in India. Know more about 
us by visiting http://datameet.org
--- 
You received this message because you are subscribed to the Google Groups 
"datameet" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to datameet+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to