[matplotlib-devel] append a NaN (missing value) to ndarray
Dear all, I have a variable d which has several years plus 11 month data (len(d)%12=11). so I want to append a NaN to the data so that it constitutes complete several years of data. but I cannot use "d=np.concatenate(d,np.array(np.nan))" to finish this job. another question, is there a simple function like is.Nan(ndarray) in numpy to check the missing value? and how can I get the index of the missing value? Thanks a lot, Chao In [246]: d Out[246]: array([-24. , -12.9, -14. , 4.2, 7.3, 12.9, 18.5, 16.9, 10.7, 7.6, -1.9, -9.8, -12. , -16.6, -13.3, 5. , 12.2, 14. , 16.5, 15.6, 11.8, 6.4, -6.6, -14.8, -17.6, -15.4, -3.7, -2.1, 6.9, 12.8, 17. , 16.7, 9. , 4.5, -11.9, -18.1, -18.4, -19.5, -3.4, 6.4, 8.5, 13.5, 18.3, 16.5, 10.4, 1.7, -9.6, -19.5, -17.8, -20.9, -10.9, 0.8, 7.7, 14.7, 20.4, 16.2, 9.1, 6.9, -8.6, -17.1, -16.6, -20.8, -14.1, -4.7, 10.7, 15.8, 18.5, 17.1, 12.9, 5.2, -6. , -18.4, -20.5, -22.6, -8.3, 7. , 10.9, 14. , 17.1, 18.6, 10.1, 2.1, -1.1, -20.8, -32.9, -17.7, -12.2, -0.4, 9.5, 14.6, 17.3, 15.1, 11.1, 2.6, -9.9, -16.9, -22.9, -18.1, -15.4, 0.5, 11. , 12.4, 16.9, 14.7, 9.7, -0.3, -10.7, -20.7, -23.1, -13.5, -10.7, 7.6, 11. , 14.4, 16.8, 15.6, 11.2, 4.2, -3.5, -12.2, -19.9, -13.2, -10.1, -0.1, 8.5, 13.6, 17.2, 17.6, 10.1, 6.3, -2.3, -12.4, -27.2, -9.1, -13. , -6.2, 7.4, 12.9, 17.3, 14.8, 9.5, 4.3, -1.1, -8.6, -17.5, -18.5, -15.9, 3.5, 9.6, 15.7, 18.4, 17.1, 9.4, 4.5, -15.1, -21.9, -21.2, -18.5, -12.2, -2.1, 10.4, 16.7, 17. , 16.1, 8.6, 3.9, -4.8, -16. , -20.9, -16.8, -9.3, 0.9, 10.3, 13.8, 19. , 15.3, 11.1, 3.1, -5.5, -14.9, -12.8, -17.5, -6.9, 3.7, 11.1, 12.5, 16.5, 16.5, 10.2, 4.2, -8.8, -16.3, -24.4, -17.2, -4.7, 3.5, 8. , 14. , 18.3, 14.6, 8.9, -0.4, -9.1, -8.4, -20.8, -15.5, -12. , 2.3, 9.8, 13.6, 18.4, 16.8, 11.9, 3.9, -8. , -13.6, -17.4, -13.1, -6.9, 0.2, 10.6, 17.6, 17.2, 18.8, 6.3, 3.4, -7.6, -22.7, -19.5, -20.9, -11.7, 1.7, 9.8, 16.6, 16.4, 16.2, 10.6, 6.1, -3.6, -14.4, -22.2, -17.8, -7.5, 3.2, 8.9, 14.8, 18.6, 17.7, 12.9, 8.4, -6.9, -16.8, -16.4, -10.1, -15.6, 3.5, 11.2, 14.7, 19.5, 14.6, 8.3, 4.4, -8.2, -22.3, -23. , -21.8, -14.1, 2.5, 9.1, 15. , 17.9, 16.4, 5.3, 5.2, -11.6, -14.1, -29. , -20.5, -8.1, -0.7, 10.1, 13.9, 17.3, 15.5, 12.4, 3.4, -13.3, -15.1, -21. , -19.5, -12.5, -2.4, 8.9, 13.5, 17.6, 17.3, 14.4, 2.7, -5.1, -15.5, -20.7, -14.5, -3.2, 2.7, 9.6, 14.3, 16. , 13.7, 10.9, 3.2, -4.1, -18.6, -29.2, -16.7, -11. , 5.1, 9.2, 12.5, 16.2, 17.5, 10.2, -0.8, -5.3, -11.4, -20.9, -15. , -12.8, 2.1, 8.8, 16.9, 18.2, 16.1, 9.9, 3.4, -9. , -23.5, -25.2, -15.4, -10.3, 2.5, 11.7, 14.5, 15.4, 17.8, 9.9, 3.5, -7.4, -20.7, -25.1, -22.6, -9.7, 1.2, 11.6, 16.3, 14.8, 17.4, 5.9, 0.9, -6.8, -21.4, -16.6, -15.8, -4.1, 1.7, 10.9, 14.5, 16.8, 16.8, 9.8, 4.2, -12.8, -18.5, -25.2, -16.8, -14.6, 2.4, 6.2, 14.9, 17.9, 13.6, 7.6, 5.3, -4.2, -8.5, -17.5, -17.7, -13.4, 0.1, 8.8, 14.3, 19.3, 14. , 10. , 3.5, -6.1, -16.8, -16.5, -12.5, -10. , 5.8, 11.6, 14.4, 17.7, 16.7, 11.6, 1.4, -7.3, -16. , -22.2, -7.8, -5.1, 6. , 13.6, 15.5, 16.3, 12.3, 9.8, 5.2, -7.9, -21.1, -24.2, -17.4, -7.6, 2.5, 11.7, 15.4, 16.7, 14.4, 10.6, 5.9, -10.4, -18. , -21.5, -25.6, -10.2, -2.9, 7.8, 15. , 19.2, 15.3, 11.3, 4.4, -6. , -14.4, -21. , -15.4, -11.5, 7.4, 13.3, 15.2, 17.6, 15.1, 9.3, 5. , -4.4, -19.4, -12.6, -11.4, -2.6, 3.2, 10.9, 14.4, 17.9, 19.1, 11.8, 1.9, -0.9, -14.2, -29.7, -17.6, -9.6, 0.5, 9.2, 14.3, 17.7, 14.6, 10.1, 4.2, -10.7, -14.4, -14.5, -13.1, -8.5, 0.5, 8. , 15.1, 18.8, 19.4, 9.3, 4.4, -3.2, -23.6, -14.2, -6.7, -8. , 6.8, 9. , 15.8, 18.6, 18.8, 7.6, 2.2, -11.3, -21.2, -17.2, -19.5, -4.9, 4.3, 11.8, 12.3, 17.1, 14.3, 7.7, 3. , -16.7, -14.2, -11.7, -16.4, -3.8, 2.1, 12.1, 15.3, 16.9, 16.2, 8.5, 4.7, -10.7, -10.7, -11.6, -10.2, -6.2, 6.4, 12.7, 17.9, 17.3, 13.7, 12.6, 3.6, -2.7, -10.8, -20.3, -15.3, -6.8, 4. , 13.9, 19.3, 18.5, 15.8, 10.9, 3. , -5.3, -12.3, -15.7, -16.7, -12.3, 3.5, 10.7, 16. , 19.8, 17.1, 10.8, 4.1, -9.1, -18.6, -15.9, -17.7, -4.2, 2.6, 10.3, 16.4, 17.3, 16.9, 12.2, 1.7, -9.7, -21.7, -19.3, -10.7, -9.5, 4.7, 11.3, 16.5, 18.5, 19.8,
Re: [matplotlib-devel] append a NaN (missing value) to ndarray
On Thu, Sep 29, 2011 at 9:33 AM, Chao YUE wrote: > Dear all, I have a variable d which has several years plus 11 month data > (len(d)%12=11). so I want to append a NaN to the data so that it constitutes > complete > several years of data. > > but I cannot use "d=np.concatenate(d,np.array(np.nan))" to finish this job. > > > another question, is there a simple function like is.Nan(ndarray) in numpy > to check the missing value? and how can I get the index of the missing > value? > > Thanks a lot, > > Chao > > In [246]: d > Out[246]: > array([-24. , -12.9, -14. , 4.2, 7.3, 12.9, 18.5, 16.9, 10.7, > 7.6, -1.9, -9.8, -12. , -16.6, -13.3, 5. , 12.2, 14. , > 16.5, 15.6, 11.8, 6.4, -6.6, -14.8, -17.6, -15.4, -3.7, > -2.1, 6.9, 12.8, 17. , 16.7, 9. , 4.5, -11.9, -18.1, >-18.4, -19.5, -3.4, 6.4, 8.5, 13.5, 18.3, 16.5, 10.4, > 1.7, -9.6, -19.5, -17.8, -20.9, -10.9, 0.8, 7.7, 14.7, > 20.4, 16.2, 9.1, 6.9, -8.6, -17.1, -16.6, -20.8, -14.1, > -4.7, 10.7, 15.8, 18.5, 17.1, 12.9, 5.2, -6. , -18.4, >-20.5, -22.6, -8.3, 7. , 10.9, 14. , 17.1, 18.6, 10.1, > 2.1, -1.1, -20.8, -32.9, -17.7, -12.2, -0.4, 9.5, 14.6, > 17.3, 15.1, 11.1, 2.6, -9.9, -16.9, -22.9, -18.1, -15.4, > 0.5, 11. , 12.4, 16.9, 14.7, 9.7, -0.3, -10.7, -20.7, >-23.1, -13.5, -10.7, 7.6, 11. , 14.4, 16.8, 15.6, 11.2, > 4.2, -3.5, -12.2, -19.9, -13.2, -10.1, -0.1, 8.5, 13.6, > 17.2, 17.6, 10.1, 6.3, -2.3, -12.4, -27.2, -9.1, -13. , > -6.2, 7.4, 12.9, 17.3, 14.8, 9.5, 4.3, -1.1, -8.6, >-17.5, -18.5, -15.9, 3.5, 9.6, 15.7, 18.4, 17.1, 9.4, > 4.5, -15.1, -21.9, -21.2, -18.5, -12.2, -2.1, 10.4, 16.7, > 17. , 16.1, 8.6, 3.9, -4.8, -16. , -20.9, -16.8, -9.3, > 0.9, 10.3, 13.8, 19. , 15.3, 11.1, 3.1, -5.5, -14.9, >-12.8, -17.5, -6.9, 3.7, 11.1, 12.5, 16.5, 16.5, 10.2, > 4.2, -8.8, -16.3, -24.4, -17.2, -4.7, 3.5, 8. , 14. , > 18.3, 14.6, 8.9, -0.4, -9.1, -8.4, -20.8, -15.5, -12. , > 2.3, 9.8, 13.6, 18.4, 16.8, 11.9, 3.9, -8. , -13.6, >-17.4, -13.1, -6.9, 0.2, 10.6, 17.6, 17.2, 18.8, 6.3, > 3.4, -7.6, -22.7, -19.5, -20.9, -11.7, 1.7, 9.8, 16.6, > 16.4, 16.2, 10.6, 6.1, -3.6, -14.4, -22.2, -17.8, -7.5, > 3.2, 8.9, 14.8, 18.6, 17.7, 12.9, 8.4, -6.9, -16.8, >-16.4, -10.1, -15.6, 3.5, 11.2, 14.7, 19.5, 14.6, 8.3, > 4.4, -8.2, -22.3, -23. , -21.8, -14.1, 2.5, 9.1, 15. , > 17.9, 16.4, 5.3, 5.2, -11.6, -14.1, -29. , -20.5, -8.1, > -0.7, 10.1, 13.9, 17.3, 15.5, 12.4, 3.4, -13.3, -15.1, >-21. , -19.5, -12.5, -2.4, 8.9, 13.5, 17.6, 17.3, 14.4, > 2.7, -5.1, -15.5, -20.7, -14.5, -3.2, 2.7, 9.6, 14.3, > 16. , 13.7, 10.9, 3.2, -4.1, -18.6, -29.2, -16.7, -11. , > 5.1, 9.2, 12.5, 16.2, 17.5, 10.2, -0.8, -5.3, -11.4, >-20.9, -15. , -12.8, 2.1, 8.8, 16.9, 18.2, 16.1, 9.9, > 3.4, -9. , -23.5, -25.2, -15.4, -10.3, 2.5, 11.7, 14.5, > 15.4, 17.8, 9.9, 3.5, -7.4, -20.7, -25.1, -22.6, -9.7, > 1.2, 11.6, 16.3, 14.8, 17.4, 5.9, 0.9, -6.8, -21.4, >-16.6, -15.8, -4.1, 1.7, 10.9, 14.5, 16.8, 16.8, 9.8, > 4.2, -12.8, -18.5, -25.2, -16.8, -14.6, 2.4, 6.2, 14.9, > 17.9, 13.6, 7.6, 5.3, -4.2, -8.5, -17.5, -17.7, -13.4, > 0.1, 8.8, 14.3, 19.3, 14. , 10. , 3.5, -6.1, -16.8, >-16.5, -12.5, -10. , 5.8, 11.6, 14.4, 17.7, 16.7, 11.6, > 1.4, -7.3, -16. , -22.2, -7.8, -5.1, 6. , 13.6, 15.5, > 16.3, 12.3, 9.8, 5.2, -7.9, -21.1, -24.2, -17.4, -7.6, > 2.5, 11.7, 15.4, 16.7, 14.4, 10.6, 5.9, -10.4, -18. , >-21.5, -25.6, -10.2, -2.9, 7.8, 15. , 19.2, 15.3, 11.3, > 4.4, -6. , -14.4, -21. , -15.4, -11.5, 7.4, 13.3, 15.2, > 17.6, 15.1, 9.3, 5. , -4.4, -19.4, -12.6, -11.4, -2.6, > 3.2, 10.9, 14.4, 17.9, 19.1, 11.8, 1.9, -0.9, -14.2, >-29.7, -17.6, -9.6, 0.5, 9.2, 14.3, 17.7, 14.6, 10.1, > 4.2, -10.7, -14.4, -14.5, -13.1, -8.5, 0.5, 8. , 15.1, > 18.8, 19.4, 9.3, 4.4, -3.2, -23.6, -14.2, -6.7, -8. , > 6.8, 9. , 15.8, 18.6, 18.8, 7.6, 2.2, -11.3, -21.2, >-17.2, -19.5, -4.9, 4.3, 11.8, 12.3, 17.1, 14.3, 7.7, > 3. , -16.7, -14.2, -11.7, -16.4, -3.8, 2.1, 12.1, 15.3, > 16.9, 16.2, 8.5, 4.7, -10.7, -10.7, -11.6, -10.2, -6.2, > 6.4, 12.7, 17.9, 17.3, 13.7, 12.6, 3.6, -2.7, -10.8, >-20.3, -15.3, -6.8, 4. , 13.9, 19.3, 18.5, 15.8, 10.9, > 3. , -5.3, -12.3, -15.7, -16.7, -12.3, 3.5, 10.7, 16
Re: [matplotlib-devel] append a NaN (missing value) to ndarray
29.09.2011 17:38, Benjamin Root kirjoitti: [clip] > but I cannot use "d=np.concatenate(d,np.array(np.nan))" to finish this job. [clip] Do d = np.concatenate([d, np.array([np.nan])]) or d = np.hstack([d, np.nan]) or d = np.r_[d, np.nan] -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] append a NaN (missing value) to ndarray
Thanks Ben! it works fine! help me a lot. Chao 2011/9/29 Pauli Virtanen > 29.09.2011 17:38, Benjamin Root kirjoitti: > [clip] > > but I cannot use "d=np.concatenate(d,np.array(np.nan))" to finish this > job. > [clip] > > Do > >d = np.concatenate([d, np.array([np.nan])]) > > or > >d = np.hstack([d, np.nan]) > > or > >d = np.r_[d, np.nan] > > > > -- > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > ___ > Matplotlib-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- *** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] append a NaN (missing value) to ndarray
Thanks a lot Pauli! Best, Chao 2011/9/29 Pauli Virtanen > 29.09.2011 17:38, Benjamin Root kirjoitti: > [clip] > > but I cannot use "d=np.concatenate(d,np.array(np.nan))" to finish this > job. > [clip] > > Do > >d = np.concatenate([d, np.array([np.nan])]) > > or > >d = np.hstack([d, np.nan]) > > or > >d = np.r_[d, np.nan] > > > > -- > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > ___ > Matplotlib-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- *** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Typo in backend_qt4.py (matplotlib-1.1.0-rc1-py2.7-python.org-macosx10.3.dmg)?
Hi,
just received
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py",
line 449, in edit_parameters
fmt = "%(axes_repr)s (%(ylabel)s)" % ylabel
TypeError: format requires a mapping
should this postfix "% label" in line 449 be removed?
Cheers and thanks for the great work,
M.
PS: Why is there no subplots.svg (only icon in NavigationToolbar with only a
.png version)
PPS: Another one caused by clicking the green flag icon ("Edit curves and ..")
in NavigationToolbar
NotImplementedError: TransformNode instances can not be copied. Consider using
frozen() instead.
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py",
line 463, in edit_parameters
figureoptions.figure_edit(axes, self)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/figureoptions.py",
line 132, in figure_edit
icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/formlayout.py",
line 511, in fedit
dialog = FormDialog(data, title, comment, icon, parent, apply)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/formlayout.py",
line 416, in __init__
parent=self)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/formlayout.py",
line 390, in __init__
widget = FormComboWidget(data, comment=comment, parent=self)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/formlayout.py",
line 368, in __init__
widget = FormWidget(data, comment=comment, parent=self)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/qt4_editor/formlayout.py",
line 233, in __init__
self.data = deepcopy(data)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
163, in deepcopy
y = copier(x, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
230, in _deepcopy_list
y.append(deepcopy(a, memo))
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
163, in deepcopy
y = copier(x, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
237, in _deepcopy_tuple
y.append(deepcopy(a, memo))
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
163, in deepcopy
y = copier(x, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
230, in _deepcopy_list
y.append(deepcopy(a, memo))
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
163, in deepcopy
y = copier(x, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
298, in _deepcopy_inst
state = deepcopy(state, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
163, in deepcopy
y = copier(x, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
257, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line
174, in deepcopy
y = copier(memo)
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py",
line 96, in __copy__
"Consider using frozen() instead.")
NotImplementedError: TransformNode instances can not be copied. Consider using
frozen() instead.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
