<div dir="ltr"><div>It seems like np.append() will work. You definitely have to use the axis=0 argument, otherwise the result is flattened.</div><div><br></div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 7, 2019 at 9:14 AM Mahesh Kovilakam <<a href="mailto:mkmvarma@gmail.com">mkmvarma@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div>I just want to append these two arrays so that the new variable will have values from 1979 through 2018. In NCL, I just use array_append_record(ext_525,merged_ext_525) which will produce an array that goes from 1979 through 2018. I am not sure in python, the "np.append" can be used. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 7, 2019 at 11:05 AM Alessandra Giannini <<a href="mailto:alesall@iri.columbia.edu" target="_blank">alesall@iri.columbia.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div><br></div>hi, are you sure that you want to concatenate these two matrices?<div>According to the information you printed out, time intervals are 1979-2016 for one, and 2002-2018 for the other…</div><div>warm regards, alessandra</div><div><br></div><div><br></div><div><br><div>
<div dir="auto" style="overflow-wrap: break-word;"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">—</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Alessandra Giannini<br>IRI for Climate and Society - The Earth Institute at Columbia University<br>P.O. Box 1000, Palisades NY 10964-8000<br>phone/fax: +1 845 680-4473/4864 - <a href="mailto:alesall@iri.columbia.edu" target="_blank">email: alesall@iri.columbia.edu</a></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><br class="gmail-m_8516772035359053971gmail-m_2866103007963595764Apple-interchange-newline"></div><br class="gmail-m_8516772035359053971gmail-m_2866103007963595764Apple-interchange-newline">
</div>
<div><br><blockquote type="cite"><div>On Jun 7, 2019, at 10:54 AM, Mahesh Kovilakam <<a href="mailto:mkmvarma@gmail.com" target="_blank">mkmvarma@gmail.com</a>> wrote:</div><br class="gmail-m_8516772035359053971gmail-m_2866103007963595764Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div>I am now transitioning to python and I recently installed PynGL and now converting one NCL script to python. I would like to concatenate two arrays and in NCL it was easy using "array_append_record". For python, I used "<span style="font-family:Menlo;font-size:11px;background-color:rgb(254,244,156)">np.concatenate(array1,array2,axis=0)</span>" but it gives me this error:</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">  File "MERGE_netcdf_test.py", line 86, in <module></span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">    merge_data = np.concatenate(ext_525_v11,ext_525_v2,axis=0)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">TypeError: 'NioVariable' object cannot be interpreted as an integer</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>I am not sure what that means. Here are the two variables I am trying to concatenate:</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Variable: ext_525</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 5253120 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            1313280 values</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 4</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>[year | 38] x [month | 12] x [lat | 32] x [alt | 90]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            year: [1979..2016]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            month: [1..12]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            lat: [-77.5..77.5]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            alt: [0.5..45]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Number of Attributes: 2</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         _FillValue :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>-999</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         mwv :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>0.525</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Variable: MERGED_EXT_525</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 2350080 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            587520 values</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 4</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>[year | 17] x [month | 12] x [lat | 32] x [alt | 90]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            year: [2002..2018]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            month: [1..12]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            lat: [-77.5..77.5]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">            alt: [0.5..45]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">Number of Attributes: 6</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         mwv :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>0.525</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         description :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>zonally averaged cloud cleared extinction at 525 nm</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         average_op_ncl :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>dim_avg_n over dimension(s): profiles</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         long_name :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>merged extinction from OSIRIS, CALIPSO, and SAGEIII-ISS at 525 nm</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         units :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>1/km</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;background-color:rgb(254,244,156)"><span style="font-variant-ligatures:no-common-ligatures">         _FillValue :<span class="gmail-m_8516772035359053971gmail-m_2866103007963595764gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>-999</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><br></div><div>And my apologies of posting this question in NCL talk. I don't know if I could post this question to any other forum so posting it here. <br></div><div><br></div><div>Thanks,</div><div>Mahesh</div></div></div></div></div></div>
_______________________________________________<br>ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div></blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>