I am new to Python and trying to essentially do the following four things   Pull numerical data (likely floats) from a csv Turn those floats into variables Perform an operation (multiplication, addition, subtraction, etc.) on those variables Output those variables to a new list   I am attempting to perform multiplication in the code below, but instead it ends up just printing the value 3 times.   import csv with open('pull_vars.csv', 'r+') as pullfile:     reader = csv.reader(pullfile)        mydict = {rows[0]:rows[1] for rows in reader} for rows in mydict:     mydict[rows] *= 3 print(mydict)   My input  {'1': ' 1', '2': ' 2', '3': ' 3', '4': ' 4', '5': ' 5', '6': ' 6', '7': ' 7', '8': ' 8', '9': ' 9'}   My output ends up looking like this  {'1': ' 1 1 1', '2': ' 2 2 2', '3': ' 3 3 3', '4': ' 4 4 4', '5': ' 5 5 5', '6': ' 6 6 6', '7': ' 7 7 7', '8': ' 8 8 8', '9': ' 9 9 9'}   How can I perform the operation on the value (as a number) versus as a string? Thanks for any help! EDIT 1: The operation I want to do is multiply all values in my dictionary (generated via CSV) by 3.  EDIT 2: before, I showed the dictionary created from my csv input, rather than the csv input itself. My CSV input is.   1, 1 2, 2 3, 3 4, 4 5, 5 6, 6 7, 7 8, 8 9, 9
In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.
For example:     The word rarely turns up outside of those contexts.      The word turns up rarely outside of those contexts.   Which one is correct and why? Can "Wow!" be a sentence? The question is clear. Can "Wow!" be a sentence?  Imagine a hypothetical context where I'd utter something like this:     Wow! What an amazing idea! I should think about a way to push this fix.   We see "wow" in casual speech often. It bears punctuation marks (typically an exclamation mark, denoting the rising intonation) and a capital letter &mdash; just like all "regular" sentences.  On the other hand, neither Wow! nor What an amazing idea! contain any verbs. These certainly don't have any parts of speech in the other sentence, so what are they? Are they sentences or clauses? In other words, can "Wow!" be a sentence despite its lack of [any implied] verbs, and subsequently lack of any distinguishable predicates?  Please back up your answers with references. I would like to open 4 Notepad++ windows at once, in the same pannel. Currently, I am only able to split it into two, and would like to know if there is a plugin that enables 4 views at at same time, or 3.   thanks Please be kind, I am an electronics nub.  This is in reference to getting an LED to emit photons.  From what I read (Getting Started in Electronics - Forrest Mims III and Make: Electronics) electrons flow from the more negative side to the more positive side.  In an example experiment (involving a primary dry cell, a SPDT switch, a resistor and an LED) it states that the resistor MUST be connected to the anode of the LED.  In my mind, if the electrons flow from negative to positive, wouldn't the electron flow run through the LED before the resistor; thereby making the resistor pointless? Recently, on my Ubuntu 18.04 I have noticed that at least on gnome-calculator and chromium browser the fonts are displayed as squares. I have followed instructions  and , the calculator is fixed, but the problem on chromium still exists when I open a dialog to search for a file.  Not sure if this happens on other applications as well, I haven't checked all my apps, but File managers nemo and nautilus are working fine.  Also, before few months ago, I have included some windows fonts for my libre office shown . I used the copy (cp) method, not the link (ln -s). But, was working fine until yesterday. Haven't done any major change or update, at least on my Linux partition (dual boot). But, I don't think that this has anything to do with that.  Any idea how can I fix this issue?  . I have an existing windows application, for which I have decided to create a Mac version. The problem is that the current UI involves a lot of buttons, tabbed panels, multiple windows etc.  This UI had been rated as intuitive and easy to use and straightforward  by many customers and editors. But a beginner (very less experience) may find in confusing a little, but it has been complemented with tutorial.      When creating the Macintosh variant, should I focus on creating a simplified and minimalistic UI (this does not mean the current UI is complex, but I think Mac user's prefer a simple UI right?) or should I try to copy the exact same thing?  By reducing the UI some of the features may be missing. But it can be added later if needed. Should I focus on a fresh approach (this is easier rather than copying the complex UI pattern) or should I go with the old recognized setup? Considering phrases of the form "I left [the] X", what causes some words to need a "the" before them, while it sounds awkward with others?  Needs "the":   I left the office I left the bank I left the house I left the courthouse   Awkward with "the":   I left work I left social media I left New York   Either way works:   I left [the] school I left [the] church If $a\neq 1$, find $(a+1)(a^2+1)(a^4+1)\ldots(a^{2^n}+1)$. If $a\neq 1$, find $$(a+1)(a^2+1)(a^4+1)\ldots(a^{2^n}+1)$$   Or i.e.     If $a\neq 1$, find $\prod_{i=0}^n(a^{2^i}+1)$.   It really does seem like $$(a+1)(a^2+1)(a^4+1)\ldots(a^{2^n}+1)=a^{2^n+2^{n-1}+\ldots+2+1}+a^{2^n+2^{n-1}+\ldots+2+1-1}+a^{2^n+2^{n-1}+\ldots+2+1-2}+\ldots+a^2+a+1$$  Or i.e. $$\prod_{i=0}^n(a^{2^i}+1)=\sum_{i=0}^{2^n+2^{n-1}+\ldots+2+1}a^i$$  Is there an interesting proof of this? I'd appreciate any help. Is there a keyboard command for 'show desktop'? Like Windows, I want to hit Super+D to jump to the desktop or minimize all windows. I don't see command like that in Keyboard Shortcuts. Any idea? dd aplied to dev USB before connect corrupt /dev/sdX and dont work Looking for a Pre-1975, young adult, sci-fi, colored circle dimension crossing Looking for the title and or author of a long ago favorite; I have searched the web for it on and off for years.  I read a paperback novel about 40 years ago; it was probably a used book at that time. Probably pre-1975 publication.  In my memory it was written in the style of Andre Norton I have looked through her , but I am not finding it. It was a young adult sci-fi novel.  Plot; a young woman (gender was not strong, but I remember the main character being female) can see different colored circles floating around. When she looks at them just right, she can jump through to another universe.  In the other universe, things change.  She might become a lion, or maybe she is carrying a seed that becomes a net in the other universe.   Two bad guys are chasing her around the different dimensions, I recall one scene where they are all sliding down an icy slope and she jumps through a portal, to escape the bad guys.   There were a lot of complexities about, dimensions, what became what, different colors of portals and such. Is it possible to smooth or generalize a polygon in QGIS, perhaps by using a plugin like the generalizer-plugin for lines?  I could convert my polygons to lines, smooth them and convert them back to polygons but this is not working for my polygons because of several reasons. If a batsman hits the ball inside the ground and begins running between the wickets and now the ball is thrown back to the Fielder/Bowler/WK(FBWK)    If the FBWK catches the ball in one hand and hits the stumps with other hand before the batsman gets reached, is this a run out? If the FBWK catches the ball in hands and hits the stumps with leg or any other part of his body before the batsman gets reached, is this a run out?   This scenario can occur, when the ball was thrown far away from stumps. In  (not feature request), :  ... if we find that people are abusing the system their accounts may get suspended. I would consider that kind of behavior abuse.  Well  sure qualifies. He has 11 Stack Exchange accounts and has in the last day spammed at least 8 of them to gain the Suffrage and sometimes Vox Populi badges. That's over 250 votes† in just a few hours! (And  -- while voting on other user's posts too.) I guarantee that he's not voting on those posts for/by their merits. Here's when he scammed the Suffrage badge per site (while also gaming the Vox Populi on some sites):                      - 2017-03-11 16:23:15Z                     - 2017-03-11 17:41:41Z                     - 2017-03-11 18:08:13Z                           - 2017-03-11 19:25:10Z                  - 2017-03-11 19:55:16Z                               - 2017-03-11 20:00:49Z               - 2017-03-11 20:03:13Z  - 2017-03-11 21:11:40Z  Note that he got the badge on three sites within an 8 minute span (but that might just be job run times). Please revoke badges gained through improper voting. And, maybe also warn/suspend such abusive voters.   † His account vote totals don't show all votes as some serial voting was reversed -- but none of the ill-gotten badges were. How to skip kernel update? Nested sequences of balls in a Banach space This seems to be a fairly easy question but I'm looking for new points of view on it and was wondering if anyone might be able to help.  (By the way- this question does come from home-work, but I've already solved and handed it, and I'm posting this out of interest, so no HW tag.)     Let $B_n=B(x_n,r_n)$ be a sequence of nested closed balls in a Banach space $X$. Prove that $\bigcap_{n=1}^\infty B_n\neq\varnothing$.   As I said before, it should be rather simple. When the radii decrease to 0, it's just a matter of selecting any sequence of points in $B_n$, and it must be Cauchy- and the limit is in the intersection.  My question is what to do when the radii do not decrease to 0? I got some tips about multiplying the balls by a sequence of decreasing scalars, or reducing the radii so that they decrease to 0, but found too many pathological cases for both methods.  Finally- I used a geometric arguemnt (which i've shown to work in any normed space) that if $B(x_1,r_1)\subset B(x_2,r_2)$ then $\| x_1-x_2\|\leq|r_1-r_2|$. This turned out to be some kind of technical catastrophe, but it worked...  Still, if anyone knows of a more elegant solution, I'd love to hear about it. Hazard Function - Survival Analysis I just started taking survival analysis class and I'm stumped on this question.  Let $T_1,...,T_n$ random independent continuous variables, with hazard function of $h_1(t),...,h_n(t)$. $T=min(T_1,...,T_n)$. And we need to show that the hazard function of T is $\sum_j{h_j(t)} $  Any help or direction are welcome :) Prove that if 51 positive integers between 1 and 100 are chosen, then one of them must divide another. Given $51$ integers $a_1, a_2, \ldots, a_{51}$ satisfying $1 \leq a_i \leq 100$. Prove that there exist $i$ and $j$ such that $a_i \mid a_j$.   I'm a little unsure how to approach this problem. Thanks for any help. How to show that $\int_0^1 \left(\sqrt[3]{1-x^7} - \sqrt[7]{1-x^3}\right)\;dx = 0$ How to code to skip a shapefile, if it doesn't exist? So if shapefile 'AAA010' does not exist, how can I skip the Merge and Clip and move on to the next part of the script? If possible I would like to keep the current script as it is, but by just adding else or if, Sorry still trying to learn the ins and outs.  import os, fnmatch, arcpy   arcpy.env.workspace = r'C:\Users\sysadmin\Desktop\DataMagement\Comp_3\SA_MGCP3.gdb'   fcMerged = 'MergedFeatureClass' fcClipped = 'fcClipped' fcToClip = r'C:\Users\sysadmin\Desktop\DataMagement\Country.shp'  filesMatched = list()  for root, subfolders, files in os.walk (r'C:\Users\sysadmin\Desktop\DataMagement\MGCP_Raw'):      for f in fnmatch.filer(files, 'AAA010.shp'):              filesMatched.append(os.path.join(root,f))      if filesMatched:         print ' files found - merging'         arcpy.Merge_management (filesMatched, fcMerged)         arcpy.Clip_analysis (fcMerged, fcToClip,fcClipped)      else:          print 'nothing found - skipping'