So now I have begun my new course Python in the 10 series.
https://stackoverflow.com/questions/16476924/how-to-iterate-over-rows-in-a-dataframe-in-pandas
DataFrame Iterating
Note − Do not try to modify any object while iterating. Iterating is meant for reading and the iterator returns a copy of the original object (a view), thus the changes will not reflect on the original object.
https://stackoverflow.com/questions/23330654/update-a-dataframe-in-pandas-while-iterating-row-by-row
One thing I realized how .Net had made the xml a piece of cake.
Especially after Linq to Xml , we took most of things for granted , never did a xml fail a parse.
In python I had to remove xml namespaces and then parse to get things working
def removexmlnamespaces(xst):
it = ET.iterparse(StringIO(xst))
for index, el in it:
if '}' in el.tag:
el.tag = el.tag.split('}', 1)[1] # strip all namespaces
resp = it.root
return resp
DataFrame where conditions
https://chrisalbon.com/python/data_wrangling/pandas_selecting_rows_on_conditions/
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.notnull.html
https://medium.com/ibm-data-science-experience/how-to-upload-download-files-to-from-notebook-in-my-local-machine-6a4e65a15767
Apart from this, files can be directly downloaded from IPython clicking on download and selecting the files under project.
https://stackoverflow.com/questions/16476924/how-to-iterate-over-rows-in-a-dataframe-in-pandas
DataFrame Iterating
Note − Do not try to modify any object while iterating. Iterating is meant for reading and the iterator returns a copy of the original object (a view), thus the changes will not reflect on the original object.
https://stackoverflow.com/questions/23330654/update-a-dataframe-in-pandas-while-iterating-row-by-row
XML Etree Element Tree
https://docs.python.org/3/library/xml.etree.elementtree.html
One thing I realized how .Net had made the xml a piece of cake.
Especially after Linq to Xml , we took most of things for granted , never did a xml fail a parse.
In python I had to remove xml namespaces and then parse to get things working
def removexmlnamespaces(xst):
it = ET.iterparse(StringIO(xst))
for index, el in it:
if '}' in el.tag:
el.tag = el.tag.split('}', 1)[1] # strip all namespaces
resp = it.root
return resp
DataFrame where conditions
https://chrisalbon.com/python/data_wrangling/pandas_selecting_rows_on_conditions/
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.notnull.html
https://medium.com/ibm-data-science-experience/how-to-upload-download-files-to-from-notebook-in-my-local-machine-6a4e65a15767
Apart from this, files can be directly downloaded from IPython clicking on download and selecting the files under project.
Comments
Post a Comment