Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

att.data.html 10KB

il y a 10 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Python: module att.data</title>
  3. </head><body bgcolor="#f0f0f8">
  4. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
  5. <tr bgcolor="#7799ee">
  6. <td valign=bottom>&nbsp;<br>
  7. <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="att.html"><font color="#ffffff">att</font></a>.data</strong></big></big></font></td
  8. ><td align=right valign=bottom
  9. ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/workbench/projects/att/att/data.py">c:\workbench\projects\att\att\data.py</a></font></td></tr></table>
  10. <p><tt><a href="#Data">Data</a>&nbsp;module&nbsp;for&nbsp;a&nbsp;Automatic&nbsp;Text&nbsp;Tools.<br>
  11. &nbsp;<br>
  12. (c)&nbsp;2013&nbsp;Ivan&nbsp;"Kai&nbsp;SD"&nbsp;Korystin&nbsp;<br>
  13. &nbsp;<br>
  14. License:&nbsp;GPLv3</tt></p>
  15. <p>
  16. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  17. <tr bgcolor="#aa55cc">
  18. <td colspan=3 valign=bottom>&nbsp;<br>
  19. <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
  20. <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  21. <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="cStringIO.html">cStringIO</a><br>
  22. </td><td width="25%" valign=top><a href="codecs.html">codecs</a><br>
  23. </td><td width="25%" valign=top><a href="csv.html">csv</a><br>
  24. </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
  25. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  26. <tr bgcolor="#ee77aa">
  27. <td colspan=3 valign=bottom>&nbsp;<br>
  28. <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
  29. <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
  30. <td width="100%"><dl>
  31. <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
  32. </font></dt><dd>
  33. <dl>
  34. <dt><font face="helvetica, arial"><a href="att.data.html#Data">Data</a>
  35. </font></dt><dd>
  36. <dl>
  37. <dt><font face="helvetica, arial"><a href="att.data.html#CSVData">CSVData</a>
  38. </font></dt></dl>
  39. </dd>
  40. </dl>
  41. </dd>
  42. </dl>
  43. <p>
  44. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  45. <tr bgcolor="#ffc8d8">
  46. <td colspan=3 valign=bottom>&nbsp;<br>
  47. <font color="#000000" face="helvetica, arial"><a name="CSVData">class <strong>CSVData</strong></a>(<a href="att.data.html#Data">Data</a>)</font></td></tr>
  48. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  49. <td colspan=2><tt>Class&nbsp;for&nbsp;reading&nbsp;CSV&nbsp;files.<br>&nbsp;</tt></td></tr>
  50. <tr><td>&nbsp;</td>
  51. <td width="100%"><dl><dt>Method resolution order:</dt>
  52. <dd><a href="att.data.html#CSVData">CSVData</a></dd>
  53. <dd><a href="att.data.html#Data">Data</a></dd>
  54. <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
  55. </dl>
  56. <hr>
  57. Methods defined here:<br>
  58. <dl><dt><a name="CSVData-__init__"><strong>__init__</strong></a>(self, file, encoding<font color="#909090">='utf-8'</font>, delimiter<font color="#909090">=';'</font>, quotechar<font color="#909090">='"'</font>, **kwargs)</dt><dd><tt>Constructor.<br>
  59. &nbsp;<br>
  60. filename&nbsp;-&nbsp;CSV&nbsp;table&nbsp;filename<br>
  61. encoding&nbsp;-&nbsp;CSV&nbsp;table&nbsp;encoding&nbsp;(default:&nbsp;utf-8)<br>
  62. delimiter&nbsp;-&nbsp;CSV&nbsp;table&nbsp;delimiter&nbsp;(default:&nbsp;;)<br>
  63. quotechar&nbsp;-&nbsp;CSV&nbsp;table&nbsp;quotechar&nbsp;(default:&nbsp;")</tt></dd></dl>
  64. <dl><dt><a name="CSVData-export_csv"><strong>export_csv</strong></a>(self, filename, encoding<font color="#909090">='utf-8'</font>, delimiter<font color="#909090">=';'</font>, quotechar<font color="#909090">='"'</font>, **kwargs)</dt><dd><tt>Saves&nbsp;the&nbsp;data&nbsp;to&nbsp;CSV&nbsp;file<br>
  65. &nbsp;<br>
  66. filename&nbsp;-&nbsp;CSV&nbsp;table&nbsp;filename<br>
  67. encoding&nbsp;-&nbsp;CSV&nbsp;table&nbsp;encoding&nbsp;(default:&nbsp;utf-8)<br>
  68. delimiter&nbsp;-&nbsp;CSV&nbsp;table&nbsp;delimiter&nbsp;(default:&nbsp;;)<br>
  69. quotechar&nbsp;-&nbsp;CSV&nbsp;table&nbsp;quotechar&nbsp;(default:&nbsp;")</tt></dd></dl>
  70. <hr>
  71. Data and other attributes defined here:<br>
  72. <dl><dt><strong>Reader</strong> = &lt;class att.data.Reader&gt;</dl>
  73. <dl><dt><strong>Writer</strong> = &lt;class att.data.Writer&gt;</dl>
  74. <hr>
  75. Methods inherited from <a href="att.data.html#Data">Data</a>:<br>
  76. <dl><dt><a name="CSVData-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  77. <dl><dt><a name="CSVData-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
  78. <dl><dt><a name="CSVData-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  79. <dl><dt><a name="CSVData-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns&nbsp;data&nbsp;as&nbsp;string.</tt></dd></dl>
  80. <dl><dt><a name="CSVData-add_data"><strong>add_data</strong></a>(self, other)</dt><dd><tt>Adds&nbsp;rows&nbsp;from&nbsp;another&nbsp;data&nbsp;table&nbsp;to&nbsp;this&nbsp;one.</tt></dd></dl>
  81. <dl><dt><a name="CSVData-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds&nbsp;new&nbsp;keys&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  82. <dl><dt><a name="CSVData-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds&nbsp;some&nbsp;empty&nbsp;rows&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  83. <dl><dt><a name="CSVData-col_by_idx"><strong>col_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;index</tt></dd></dl>
  84. <dl><dt><a name="CSVData-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;name</tt></dd></dl>
  85. <dl><dt><a name="CSVData-del_row"><strong>del_row</strong></a>(self, idx)</dt><dd><tt>Removes&nbsp;giver&nbsp;row&nbsp;from&nbsp;data</tt></dd></dl>
  86. <dl><dt><a name="CSVData-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;given&nbsp;key&nbsp;exists&nbsp;in&nbsp;data</tt></dd></dl>
  87. <dl><dt><a name="CSVData-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;row&nbsp;by&nbsp;index.</tt></dd></dl>
  88. <dl><dt><a name="CSVData-transpose"><strong>transpose</strong></a>(self, key_idx<font color="#909090">=0</font>)</dt><dd><tt>Returns&nbsp;the&nbsp;transposed&nbsp;copy&nbsp;of&nbsp;the&nbsp;data.<br>
  89. &nbsp;<br>
  90. key_idx&nbsp;-&nbsp;index&nbsp;of&nbsp;the&nbsp;column,&nbsp;that&nbsp;contains&nbsp;keywords&nbsp;(default:&nbsp;0)</tt></dd></dl>
  91. <hr>
  92. Data descriptors inherited from <a href="att.data.html#Data">Data</a>:<br>
  93. <dl><dt><strong>__dict__</strong></dt>
  94. <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
  95. </dl>
  96. <dl><dt><strong>__weakref__</strong></dt>
  97. <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
  98. </dl>
  99. </td></tr></table> <p>
  100. <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
  101. <tr bgcolor="#ffc8d8">
  102. <td colspan=3 valign=bottom>&nbsp;<br>
  103. <font color="#000000" face="helvetica, arial"><a name="Data">class <strong>Data</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
  104. <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
  105. <td colspan=2><tt>Empty&nbsp;data&nbsp;class.&nbsp;Can&nbsp;be&nbsp;used&nbsp;for&nbsp;a&nbsp;subclassing&nbsp;or&nbsp;procedural&nbsp;data&nbsp;creation.<br>&nbsp;</tt></td></tr>
  106. <tr><td>&nbsp;</td>
  107. <td width="100%">Methods defined here:<br>
  108. <dl><dt><a name="Data-__getitem__"><strong>__getitem__</strong></a>(self, pair)</dt><dd><tt>Returns&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  109. <dl><dt><a name="Data-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt><dd><tt>Constructor</tt></dd></dl>
  110. <dl><dt><a name="Data-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
  111. <dl><dt><a name="Data-__setitem__"><strong>__setitem__</strong></a>(self, pair, value)</dt><dd><tt>Sets&nbsp;a&nbsp;value&nbsp;for&nbsp;given&nbsp;key&nbsp;and&nbsp;row.</tt></dd></dl>
  112. <dl><dt><a name="Data-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Returns&nbsp;data&nbsp;as&nbsp;string.</tt></dd></dl>
  113. <dl><dt><a name="Data-add_data"><strong>add_data</strong></a>(self, other)</dt><dd><tt>Adds&nbsp;rows&nbsp;from&nbsp;another&nbsp;data&nbsp;table&nbsp;to&nbsp;this&nbsp;one.</tt></dd></dl>
  114. <dl><dt><a name="Data-add_keys"><strong>add_keys</strong></a>(self, *h)</dt><dd><tt>Adds&nbsp;new&nbsp;keys&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  115. <dl><dt><a name="Data-add_rows"><strong>add_rows</strong></a>(self, n<font color="#909090">=1</font>)</dt><dd><tt>Adds&nbsp;some&nbsp;empty&nbsp;rows&nbsp;to&nbsp;the&nbsp;data.</tt></dd></dl>
  116. <dl><dt><a name="Data-col_by_idx"><strong>col_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;index</tt></dd></dl>
  117. <dl><dt><a name="Data-col_by_key"><strong>col_by_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;a&nbsp;column&nbsp;by&nbsp;header's&nbsp;name</tt></dd></dl>
  118. <dl><dt><a name="Data-del_row"><strong>del_row</strong></a>(self, idx)</dt><dd><tt>Removes&nbsp;giver&nbsp;row&nbsp;from&nbsp;data</tt></dd></dl>
  119. <dl><dt><a name="Data-has_key"><strong>has_key</strong></a>(self, key)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;given&nbsp;key&nbsp;exists&nbsp;in&nbsp;data</tt></dd></dl>
  120. <dl><dt><a name="Data-row_by_idx"><strong>row_by_idx</strong></a>(self, idx)</dt><dd><tt>Returns&nbsp;a&nbsp;row&nbsp;by&nbsp;index.</tt></dd></dl>
  121. <dl><dt><a name="Data-transpose"><strong>transpose</strong></a>(self, key_idx<font color="#909090">=0</font>)</dt><dd><tt>Returns&nbsp;the&nbsp;transposed&nbsp;copy&nbsp;of&nbsp;the&nbsp;data.<br>
  122. &nbsp;<br>
  123. key_idx&nbsp;-&nbsp;index&nbsp;of&nbsp;the&nbsp;column,&nbsp;that&nbsp;contains&nbsp;keywords&nbsp;(default:&nbsp;0)</tt></dd></dl>
  124. <hr>
  125. Data descriptors defined here:<br>
  126. <dl><dt><strong>__dict__</strong></dt>
  127. <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
  128. </dl>
  129. <dl><dt><strong>__weakref__</strong></dt>
  130. <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
  131. </dl>
  132. </td></tr></table></td></tr></table>
  133. </body></html>