473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to print from a csv file

hi to all, please i am also new to python programming,
i have a csv file that contains two columns,here is it below,goes all the way down.

i want to be able to import the file which i did,but the problem is that i want to count the k and record how many times it occurs,for instance 106 appeared just once,61 once and so on like that,after which i will record it in the next column as sum(k)
Expand|Select|Wrap|Line Numbers
  1. p(ki)            k    sum(k)    p(ki2)
  2. 0.117909    106    1    0.00209205
  3. 0.067853    61    1    0.00209205
  4. 0.048943    44    1    0.00209205
  5. 0.047831    43    3    0.006276151
  6. 0.047831    43        
  7. 0.047831    43        
  8. 0.046719    42    2    
  9. 0.046719    42        
  10. 0.045606    41    1    
  11. 0.044494    40        
  12. 0.043382    39        
  13. 0.038932    35        
  14. 0.038932    35        
  15. 0.03782            34        
  16. 0.03782            34        
  17. 0.03782            34        
  18. 0.03782            34        
  19. 0.03782            34        
  20. 0.03782            34        
  21. 0.03782            34        
  22. 0.03782            34        
  23. 0.036707    33        
  24. 0.036707    33        
  25. 0.036707    33        
  26. 0.036707    33        
  27. 0.036707    33        
  28. 0.036707    33        
  29. 0.036707    33        
  30. 0.036707    33        
  31. 0.035595    32        
  32. 0.035595    32        
  33. 0.035595    32        
  34. 0.035595    32        
  35. 0.035595    32        
  36. 0.035595    32        
  37. 0.035595    32        
  38. 0.035595    32        
  39. 0.035595    32        
  40. 0.035595    32        
  41. 0.035595    32        
  42. 0.035595    32        
  43. 0.035595    32        
  44. 0.035595    32        
  45. 0.035595    32        
  46. 0.035595    32        
  47. 0.035595    32        
  48. 0.035595    32        
  49. 0.035595    32        
  50. 0.035595    32        
  51. 0.035595    32        
  52. 0.035595    32        
  53. 0.035595    32        
  54. 0.035595    32        
  55. 0.035595    32        
  56. 0.034483    31        
  57. 0.034483    31        
  58. 0.034483    31        
  59. 0.034483    31        
  60. 0.034483    31        
  61. 0.034483    31        
  62. 0.034483    31        
  63. 0.034483    31        
  64. 0.034483    31        
  65. 0.034483    31        
  66. 0.034483    31        
  67. 0.034483    31        
  68. 0.034483    31        
  69. 0.034483    31        
  70. 0.034483    31        
  71. 0.03337            30        
  72. 0.03337            30        
  73. 0.03337            30        
  74. 0.03337            30        
  75. 0.03337            30        
  76. 0.03337            30        
  77. 0.03337            30        
  78. 0.025584    23        
  79. 0.017798    16        
  80. 0.015573    14        
  81. 0.014461    13        
  82. 0.013348    12        
  83. 0.012236    11        
  84. 0.012236    11        
  85. 0.012236    11        
  86. 0.012236    11        
  87. 0.012236    11        
  88. 0.011123    10        
  89. 0.011123    10        
  90. 0.011123    10        
  91. 0.011123    10        
  92. 0.011123    10        
  93. 0.011123    10        
  94. 0.011123    10        
  95. 0.011123    10        
  96. 0.011123    10        
  97. 0.010011    9        
  98. 0.008899    8        
  99. 0.008899    8        
  100. 0.008899    8        
  101. 0.008899    8        
  102. 0.007786    7        
  103. 0.007786    7        
  104. 0.007786    7        
  105. 0.007786    7        
  106. 0.007786    7        
  107. 0.006674    6        
  108. 0.006674    6        
  109. 0.006674    6        
  110. 0.006674    6        
  111. 0.006674    6        
  112. 0.005562    5        
  113. 0.004449    4        
  114. 0.004449    4        
  115. 0.004449    4        
  116. 0.004449    4        
  117. 0.004449    4        
  118. 0.004449    4        
  119. 0.004449    4        
  120. 0.004449    4        
  121. 0.004449    4        
  122. 0.004449    4        
  123. 0.004449    4        
  124. 0.003337    3        
  125. 0.003337    3        
  126. 0.003337    3        
  127. 0.003337    3        
  128. 0.003337    3        
  129. 0.003337    3        
  130. 0.003337    3        
  131. 0.003337    3        
  132. 0.003337    3        
  133. 0.003337    3        
  134. 0.003337    3        
  135. 0.003337    3        
  136. 0.003337    3        
  137. 0.003337    3        
  138. 0.003337    3        
  139. 0.003337    3        
  140. 0.002225    2        
  141. 0.002225    2        
  142. 0.002225    2        
  143. 0.002225    2        
  144. 0.002225    2        
  145. 0.002225    2        
  146. 0.002225    2        
  147. 0.002225    2        
  148. 0.002225    2        
  149. 0.002225    2        
  150. 0.002225    2        
  151. 0.002225    2        
  152. 0.002225    2        
  153. 0.002225    2        
  154. 0.002225    2        
  155. 0.002225    2        
  156. 0.002225    2        
  157. 0.002225    2        
  158. 0.002225    2        
  159. 0.002225    2        
  160. 0.002225    2        
  161. 0.002225    2        
  162. 0.002225    2        
  163. 0.002225    2        
  164. 0.002225    2        
  165. 0.002225    2        
  166. 0.002225    2        
  167. 0.002225    2        
  168. 0.002225    2        
  169. 0.002225    2        
  170. 0.002225    2        
  171. 0.002225    2        
  172. 0.002225    2        
  173. 0.002225    2        
  174. 0.002225    2        
  175. 0.002225    2        
  176. 0.002225    2        
  177. 0.002225    2        
  178. 0.002225    2        
  179. 0.002225    2        
  180. 0.002225    2        
  181. 0.002225    2        
  182. 0.002225    2        
  183. 0.002225    2        
  184. 0.002225    2        
  185. 0.002225    2        
  186. 0.002225    2        
  187. 0.002225    2        
  188. 0.002225    2        
  189. 0.002225    2        
  190. 0.002225    2        
  191. 0.002225    2        
  192. 0.002225    2        
  193. 0.002225    2        
  194. 0.002225    2        
  195. 0.002225    2        
  196. 0.002225    2        
  197. 0.002225    2        
  198. 0.002225    2        
  199. 0.002225    2        
  200. 0.002225    2        
  201. 0.002225    2        
  202. 0.002225    2        
  203. 0.002225    2        
  204. 0.002225    2        
  205. 0.002225    2        
  206. 0.002225    2        
  207. 0.002225    2        
  208. 0.002225    2        
  209. 0.002225    2        
  210. 0.002225    2        
  211. 0.002225    2        
  212. 0.002225    2        
  213. 0.002225    2        
  214. 0.002225    2        
  215. 0.002225    2        
  216. 0.002225    2        
  217. 0.002225    2        
  218. 0.002225    2        
  219. 0.002225    2        
  220. 0.002225    2        
  221. 0.002225    2        
  222. 0.002225    2        
  223. 0.002225    2        
  224. 0.002225    2        
  225. 0.002225    2        
  226. 0.002225    2        
  227. 0.002225    2        
  228. 0.002225    2        
  229. 0.002225    2        
  230. 0.002225    2        
  231. 0.002225    2        
  232. 0.002225    2        
  233. 0.002225    2        
  234. 0.002225    2        
  235. 0.002225    2        
  236. 0.002225    2        
  237. 0.002225    2        
  238. 0.002225    2        
  239. 0.001112    1    140    0.292887029
  240. 0.001112    1        
  241. 0.001112    1        
  242. 0.001112    1        
  243. 0.001112    1        
  244. 0.001112    1        
  245. 0.001112    1        
  246. 0.001112    1        
  247. 0.001112    1        
  248. 0.001112    1        
  249. 0.001112    1        
  250. 0.001112    1        
  251. 0.001112    1        
  252. 0.001112    1        
  253. 0.001112    1        
  254. 0.001112    1        
  255. 0.001112    1        
  256. 0.001112    1        
  257. 0.001112    1        
  258. 0.001112    1        
  259. 0.001112    1        
  260. 0.001112    1        
  261. 0.001112    1        
  262. 0.001112    1        
  263. 0.001112    1        
  264. 0.001112    1        
  265. 0.001112    1        
  266. 0.001112    1        
  267. 0.001112    1        
  268. 0.001112    1        
  269. 0.001112    1        
  270. 0.001112    1        
  271. 0.001112    1        
  272. 0.001112    1        
  273. 0.001112    1        
  274. 0.001112    1        
  275. 0.001112    1        
  276. 0.001112    1        
  277. 0.001112    1        
  278. 0.001112    1        
  279. 0.001112    1        
  280. 0.001112    1        
  281. 0.001112    1        
  282. 0.001112    1        
  283. 0.001112    1        
  284. 0.001112    1        
  285. 0.001112    1        
  286. 0.001112    1        
  287. 0.001112    1        
  288. 0.001112    1        
  289. 0.001112    1        
  290. 0.001112    1        
  291. 0.001112    1        
  292. 0.001112    1        
  293. 0.001112    1        
  294. 0.001112    1        
  295. 0.001112    1        
  296. 0.001112    1        
  297. 0.001112    1        
  298. 0.001112    1        
  299. 0.001112    1        
  300. 0.001112    1        
  301. 0.001112    1        
  302. 0.001112    1        
  303. 0.001112    1        
  304. 0.001112    1        
  305. 0.001112    1        
  306. 0.001112    1        
  307. 0.001112    1        
  308. 0.001112    1        
  309. 0.001112    1        
  310. 0.001112    1        
  311. 0.001112    1        
  312. 0.001112    1        
  313. 0.001112    1        
  314. 0.001112    1        
  315. 0.001112    1        
  316. 0.001112    1        
  317. 0.001112    1        
  318. 0.001112    1        
  319. 0.001112    1        
  320. 0.001112    1        
  321. 0.001112    1        
  322. 0.001112    1        
  323. 0.001112    1        
  324. 0.001112    1        
  325. 0.001112    1        
  326. 0.001112    1        
  327. 0.001112    1        
  328. 0.001112    1        
  329. 0.001112    1        
  330. 0.001112    1        
  331. 0.001112    1        
  332. 0.001112    1        
  333. 0.001112    1        
  334. 0.001112    1        
  335. 0.001112    1        
  336. 0.001112    1        
  337. 0.001112    1        
  338. 0.001112    1        
  339. 0.001112    1        
  340. 0.001112    1        
  341. 0.001112    1        
  342. 0.001112    1        
  343. 0.001112    1        
  344. 0.001112    1        
  345. 0.001112    1        
  346. 0.001112    1        
  347. 0.001112    1        
  348. 0.001112    1        
  349. 0.001112    1        
  350. 0.001112    1        
  351. 0.001112    1        
  352. 0.001112    1        
  353. 0.001112    1        
  354. 0.001112    1        
  355. 0.001112    1        
  356. 0.001112    1        
  357. 0.001112    1        
  358. 0.001112    1        
  359. 0.001112    1        
  360. 0.001112    1        
  361. 0.001112    1        
  362. 0.001112    1        
  363. 0.001112    1        
  364. 0.001112    1        
  365. 0.001112    1        
  366. 0.001112    1        
  367. 0.001112    1        
  368. 0.001112    1        
  369. 0.001112    1        
  370. 0.001112    1        
  371. 0.001112    1        
  372. 0.001112    1        
  373. 0.001112    1        
  374. 0.001112    1        
  375. 0.001112    1        
  376. 0.001112    1        
  377. 0.001112    1        
  378. 0.001112    1        
  379. 0.001112    1        
  380. 0.001112    1        
  381. 0.001112    1        
  382. 0.001112    1        
  383. 0.001112    1        
  384. 0.001112    1        
  385. 0.001112    1        
  386. 0.001112    1        
  387. 0.001112    1        
  388. 0.001112    1        
  389. 0.001112    1        
  390. 0.001112    1        
  391. 0.001112    1        
  392. 0.001112    1        
  393. 0.001112    1        
  394. 0.001112    1        
  395. 0.001112    1        
  396. 0.001112    1        
  397. 0.001112    1        
  398. 0.001112    1        
  399. 0.001112    1        
  400. 0.001112    1        
  401. 0.001112    1        
  402. 0.001112    1        
  403. 0.001112    1        
  404. 0.001112    1        
  405. 0.001112    1        
  406. 0.001112    1        
  407. 0.001112    1        
  408. 0.001112    1        
  409. 0.001112    1        
  410. 0.001112    1        
  411. 0.001112    1        
  412. 0.001112    1        
  413. 0.001112    1        
  414. 0.001112    1        
  415. 0.001112    1        
  416. 0.001112    1        
  417. 0.001112    1        
  418. 0.001112    1        
  419. 0.001112    1        
  420. 0.001112    1        
  421. 0.001112    1        
  422. 0.001112    1        
  423. 0.001112    1        
  424. 0.001112    1        
  425. 0.001112    1        
  426. 0.001112    1        
  427. 0.001112    1        
  428. 0.001112    1        
  429. 0.001112    1        
  430. 0.001112    1        
  431. 0.001112    1        
  432. 0.001112    1        
  433. 0.001112    1        
  434. 0.001112    1        
  435. 0.001112    1        
  436. 0.001112    1        
  437. 0.001112    1        
  438. 0.001112    1        
  439. 0.001112    1        
  440. 0.001112    1        
  441. 0.001112    1        
  442. 0.001112    1        
  443. 0.001112    1        
  444. 0.001112    1        
  445. 0.001112    1        
  446. 0.001112    1        
  447. 0.001112    1        
  448. 0.001112    1        
  449. 0.001112    1        
  450. 0.001112    1        
  451. 0.001112    1        
  452. 0.001112    1        
  453. 0.001112    1        
  454. 0.001112    1        
  455. 0.001112    1        
  456. 0.001112    1        
  457. 0.001112    1        
  458. 0.001112    1        
  459. 0.001112    1        
  460. 0.001112    1        
  461. 0.001112    1        
  462. 0.001112    1        
  463. 0.001112    1        
  464. 0.001112    1        
  465. 0.001112    1        
  466. 0.001112    1        
  467. 0.001112    1        
  468. 0.001112    1        
  469. 0.001112    1        
  470. 0.001112    1        
  471. 0.001112    1        
  472. 0.001112    1        
  473. 0.001112    1        
  474. 0.001112    1        
  475. 0.001112    1        
  476. 0.001112    1        
  477. 0.001112    1        
  478. 0.001112    1        
  479. 0.001112    1
Oct 14 '10 #1
1 1381
dwblas
626 Expert 512MB
Use a dictionary (tutorial) with the number as the key, pointing to an integer that is used as a counter.
Oct 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
0
by: DotNetDummy | last post by:
Hi all, I am trying to set the printing setting e.g duplex mode etc. on a default printer when I.E object started printing a particular html doc. Here's the partial code, any help would be...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
0
by: Marco Bonifazi | last post by:
Hello! I have a file (in my situation it is a Postscript file or a Pdf file, but it isn't important). I must send this file to a printer, using Python, and I need to select the printer to...
1
by: outofmymind | last post by:
hi everyone, im trying to solve this question Write a C++ program that prints the file in reverse format character by character. can anyone please tell me if im doing it correctly #include...
0
by: dutch | last post by:
Greetings. I'm attempting to print an existing html file to a network printer. I tried opening a socket connection using the printer ip and port. With this, I was able to print the file...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.