between   545

« earlier    

numpy.random.randint — NumPy v1.14 Manual
useful method for getting either an array or a 2D matrix of randomly generated integers between two numbers.


Get a Numpy array of 100 numbers between 0 and 50

arr1 = np.random.randint(0,50, 100)

Now, suppose you want that same data in a 5 by 10 matrix. You can do this like so:

matrix_1 = arr1.reshape(5,10)
numpy  documentation  guide  reference  random  randint  method  generate  integers  between  minimum  maximum  rows  columns  shape  howto  example 
4 days ago by racl101
How to select rows in a DataFrame between two values, in Python Pandas? - Stack Overflow
If you want to derive a dataframe containing all values in any given row, column position between two numbers you can do this:

newdf = df[(df >= val1) & (df <=val2)]

it will return a new dataframe with same shape (same row and column count) but any value that doesn't fall between val1 and val2 it replaces with an NaN value.
stackoverflow  howto  pandas  python  python2.7  select  filter  rows  dataframe  between  two  values  example  guide  reference  named  columns  labelled 
4 days ago by racl101
Michael Cohen and the End Stage of the Trump Presidency | The New Yorker
t politics
Michael Cohen and the End Stage of the Trump Presidency
Adam Davidson
On May 1, 2003, the day President George W. Bush landed on the U.S.S. Abraham Lincoln in front of the massive “Mission Accomplished” sign, I was in Baghdad performing what had become a daily ritual. I went to a gate on the side of the Republican Palace, in the Green Zone, where an American soldier was receiving, one by one, a long line of Iraqis who came with questions and complaints. I remember a man complaining that his house had been run over by a tank. There was a woman who had been a government employee and wanted to know about her salary. The soldier had a form he was supposed to fill out with each person’s request and that person’s contact information. I stood there as the man talked to each person and, each time, said, “Phone number?” And each person would answer some version of “The phone system of Iraq has been destroyed and doesn’t work.” Then the soldier would turn to the next person, write down the person’s question or complaint, and then ask, “Phone number?”
I arrived in Baghdad on April 12th of that year, a few days after Saddam’s statue at Firdos Square had been destroyed. There were a couple of weeks of uncertainty as reporters and Iraqis tried to gauge who was in charge of the country and what the general plan was. There was no electricity, no police, no phones, no courts, no schools. More than half of Iraqis worked for the government, and there was no government, no Army, and so no salaries for most of the country. At first, it seemed possible that the Americans simply needed a bit of time to communicate the new rules. By the end of April, though, it was clear: there was no plan, no new order. Iraq was anarchic.
We journalists were able to use generators and satellite dishes to access outside information, and what we saw was absurd. Americans seemed convinced things were going well in Iraq. The war—and the President who launched it—were seen favorably by seventy per cent of Americans. Then came these pictures of a President touting “Mission Accomplished”—the choice of words that President Trump used in a tweet on Saturday, the morning after he ordered an air strike on Syria. On the ground, we were not prophets or political geniuses. We were sentient adults who were able to see the clear, obvious truth in front of us. The path of Iraq would be decided by those who thrived in chaos.
I had a similar feeling in December, 2007. I came late to the financial crisis. I had spent much of 2006 and 2007 naïvely swatting away warnings from my friends and sources who told me of impending disaster. Finally, I decided to take a deep look at collateralized debt obligations, or C.D.O.s, those financial instruments that would soon be known as toxic assets. I read technical books, talked to countless experts, and soon learned that these were, in Warren Buffett’s famous phrase, weapons of financial mass destruction. They were engineered in such a way that they could exponentially increase profits but would, also, exponentially increase losses. Worse, they were too complex to be fully understood. It was impossible, even with all the information, to figure out what they were worth once they began to fail. Because these C.D.O.s had come to form the core value of most major banks’ assets, no major bank had clear value. With that understanding, the path was clear. Eventually, people would realize that the essential structure of our financial system was about to implode. Yet many political figures and TV pundits were happily touting the end of a crisis. (Larry Kudlow, now Trump’s chief economic adviser, led the charge of ignorance.)
In Iraq and with the financial crisis, it was helpful, as a reporter, to be able to divide the world into those who actually understand what was happening and those who said hopeful nonsense. The path of both crises turned out to be far worse than I had imagined.
I thought of those earlier experiences this week as I began to feel a familiar clarity about what will unfold next in the Trump Presidency. There are lots of details and surprises to come, but the endgame of this Presidency seems as clear now as those of Iraq and the financial crisis did months before they unfolded. Last week, federal investigators raided the offices of Michael Cohen, the man who has been closer than anybody to Trump’s most problematic business and personal relationships. This week, we learned that Cohen has been under criminal investigation for months—his e-mails have been read, presumably his phones have been tapped, and his meetings have been monitored. Trump has long declared a red line: Robert Mueller must not investigate his businesses, and must only look at any possible collusion with Russia. That red line is now crossed and, for Trump, in the most troubling of ways. Even if he were to fire Deputy Attorney General Rod Rosenstein and then had Mueller and his investigation put on ice, and even if—as is disturbingly possible—Congress did nothing, the Cohen prosecution would continue. Even if Trump pardons Cohen, the information the Feds have on him can become the basis for charges against others in the Trump Organization.
This is the week we know, with increasing certainty, that we are entering the last phase of the Trump Presidency. This doesn’t feel like a prophecy; it feels like a simple statement of the apparent truth. I know dozens of reporters and other investigators who have studied Donald Trump and his business and political ties. Some have been skeptical of the idea that President Trump himself knowingly colluded with Russian officials. It seems not at all Trumpian to participate in a complex plan with a long-term, uncertain payoff. Collusion is an imprecise word, but it does seem close to certain that his son Donald, Jr., and several people who worked for him colluded with people close to the Kremlin; it is up to prosecutors and then the courts to figure out if this was illegal or merely deceitful. We may have a hard time finding out what President Trump himself knew and approved.
However, I am unaware of anybody who has taken a serious look at Trump’s business who doesn’t believe that there is a high likelihood of rampant criminality. In Azerbaijan, he did business with a likely money launderer for Iran’s Revolutionary Guard. In the Republic of Georgia, he partnered with a group that was being investigated for a possible role in the largest known bank-fraud and money-laundering case in history. In Indonesia, his development partner is “knee-deep in dirty politics”; there are criminal investigations of his deals in Brazil; the F.B.I. is reportedly looking into his daughter Ivanka’s role in the Trump hotel in Vancouver, for which she worked with a Malaysian family that has admitted to financial fraud. Back home, Donald, Jr., and Ivanka were investigated for financial crimes associated with the Trump hotel in SoHo—an investigation that was halted suspiciously. His Taj Mahal casino received what was then the largest fine in history for money-laundering violations.
Listing all the financial misconduct can be overwhelming and tedious. I have limited myself to some of the deals over the past decade, thus ignoring Trump’s long history of links to New York Mafia figures and other financial irregularities. It has become commonplace to say that enough was known about Trump’s shady business before he was elected; his followers voted for him precisely because they liked that he was someone willing to do whatever it takes to succeed, and they also believe that all rich businesspeople have to do shady things from time to time. In this way of thinking, any new information about his corrupt past has no political salience. Those who hate Trump already think he’s a crook; those who love him don’t care.
I believe this assessment is wrong. Sure, many people have a vague sense of Trump’s shadiness, but once the full details are better known and digested, a fundamentally different narrative about Trump will become commonplace. Remember: we knew a lot about problems in Iraq in May, 2003. Americans saw TV footage of looting and heard reports of U.S. forces struggling to gain control of the entire country. We had plenty of reporting, throughout 2007, about various minor financial problems. Somehow, though, these specific details failed to impress upon most Americans the over-all picture. It took a long time for the nation to accept that these were not minor aberrations but, rather, signs of fundamental crisis. Sadly, things had to get much worse before Americans came to see that our occupation of Iraq was disastrous and, a few years later, that our financial system was in tatters.
The narrative that will become widely understood is that Donald Trump did not sit atop a global empire. He was not an intuitive genius and tough guy who created billions of dollars of wealth through fearlessness. He had a small, sad operation, mostly run by his two oldest children and Michael Cohen, a lousy lawyer who barely keeps up the pretenses of lawyering and who now faces an avalanche of charges, from taxicab-backed bank fraud to money laundering and campaign-finance violations.
Cohen, Donald, Jr., and Ivanka monetized their willingness to sign contracts with people rejected by all sensible partners. Even in this, the Trump Organization left money on the table, taking a million dollars here, five million there, even though the service they provided—giving branding legitimacy to blatantly sketchy projects—was worth far more. It was not a company that built value over decades, accumulating assets and leveraging wealth. It burned through whatever good will and brand value it established as quickly as possible, then moved on to the next scheme.
There are important legal questions that remain. How much did Donald Trump and his children know about the criminality of their partners? How explicit were they in agreeing to put a shiny gold brand on top of corrupt deals? The answers to … [more]
Of  course  Trump  is  raging  and  furious  and  terrified.  Prosecutors  are  now  looking  at  his  core.  Cohen  was  the  key  intermediary  between  the  Trump  family  and  its  partners  around  the  world;  he  was  chief  consigliere  and  dealmaker  throughout  its  period  expansion  into  global  partnerships  with  sketchy  oligarchs.  wasn’t  a  slick  politico  who  showed  up  for  a  few  months.  knows  everything_  he  recorded  much  it_  and  now  will  know  it_  too.  It  seems  inevitable  that  much  will  be  made  public.  We  don’t  know  when.  We  don’t  know  the  precise  path  the  next  few  months  will  take.  There  will  be  resistance  and  denial  and  counterattacks.  But  seems  likely  that_  when  look  back  on  this  week_  will  see  as  a  turning  point.  We  are  now  in  the  end  stages  the  Trump  Presidency.  from iphone
6 days ago by soshdin

« earlier    

related tags

#css  #html  &  ?  (or  (what  -  10  20-year  20  2011  2016  2017  3-step  3  30  4m  50  6  :  [4]  a  access  accountability  accounts  acrylic  ad  address  addresses  affiliate  air  airdrop-style  album  alcester  allorganichome  allow  also  ambiguous  america’s  amp  an  and  anechoic  announce  antenna  any  app  appointments  apps  arabia  arbitrage  archive  archives  are  around  array  art  as  asynchronous  at&t  at  attempts  austrian  author:jaspermoore  autoimmunity  automatically  automotive  awnings  a…  b  back  bag  baggage  bags  balloon  barcode  basics:  be  berkshire  best  betweenness  big  bistable  blog  both  brackets  brake  bridging  brk-a  brk-b  browser  browser:  brython  buffer  buffers  buffet's  buffet  bus-systems  but  california  can  capitalism  categories  caught  cetitec  challenges  chamber  change  character:frigga  character:loki  character:odin  character:thanos  character:thor  character:tony_stark  checked  chief  choose  choosing  chrisalbon  clash  class  cleaning  clients/bosses  coates  codes  cohen  collaborative  collections  collision  columns  common  communication  company  compare  comparison  compensator  computers  condition  conditional  conditions  connections  conservative  consigliere  contact  contacts'  content  contents  convert  copy  core.  correction  count  counterattacks.  course  coyote  create  creating  creuset:  crime  criteria  crossover...  css  cultural  cyber  cyberwar  cypress  damage  data?  data  database  dataframe  date  dates  day  deal  dealmaker  decorator  deflation  delete  delta  denial  depth  description:canon-divergence  description:time-travel  description:tony-in-asgard  design  detector  determine  devices...  devices  difference  differences  different  digital  digitalocean  din  distance  div  dm-cache?  documentation  docx  doing.  don’t  door  downloaded  dreams  driving  dutch  e  eft  electricity  email  end  enforcement  engine  enough  enterprise  everything_  example  executives  exesion  expansion  explanation  extra  extract  f150  face  facebook  family  fandom:thor  faster  fees  few  figure  files  filter  filters  find  findout  fix  flash  flexray  fm  font-size  for  fore.  forecast  frame  frames  free  from  full  fund  fundamental  furious  galaxy  gap  gaps  garch  ge  generate  genesis  genre:slash  gestalt  glass  glazing  global  gmail  goog  googl  google's  google  government?transparent  government  grammar  grammarcorrection  grammartroll  grammartrolling  grid  group  grouped  guide  h1  happy  hathaway's  hathaway  have  he  heading  headunit  hedge  help  hider  hip  his  home  honing  horrors  how  howto  hr  html  hubs:  i  id  identifying  iframes  ifttt  image  imgur  impending  in  india  inequality  inevitable  inflation  influence  infographic  injuries  insert  install  integer  integers  interest  interesting  intermediary  interpolation  interval  interview  into  introduce  investigations:  investing  investopedia  ipad  iphone  iphonex  is  it  it_  its  itself  j7  java  java8  jm  journal  july/august  kevinstarr  key  keyboard  kingdom  know  knowledge  knows  kvm  labelled  las  later:  law  le  learned  learning  lets  liberal  life  lifetime  likely  limestone  liminality  liminalspaces  limit  lin  line-height  lines  lines:  link  list  localdate  look  looking  lordosis  losangeles  lumbar  lvmcache  lynellgeorge  mac  made  make  makedo  managers?  map  marble  marketing  massive  maximum  me  me_  merger  message  messagechannel  metal  method  minimum  models  moltenleading  months.  months  most  mouse  move  moving  moz  ms  much  multiple  multistable  muscle  mustang  muzzle  mysql  myth  n  named  national  nations_  navigate  neckercube  needsediting  network  networking  new  news  next  niches:  no  not)  now  number  numbers  numpy  o'jays  object  objects  of  officials  oligarchs.  on  one  open  openvpn  operator  other  outlook  oven  ovens?  over  overuse  page  pairing:loki/tony_stark  pandas  panorama  paradise  participatory:  partners  partnerships  path  pattern  patterns  pay  perception  perfect  performance  pergolas  period  personality  php  pigeon_  pinterest  place  placemking  plans  playlist  plover  point.  policies  polishing  politico  polycarbonate  popcorn  popping  poster  postmessage  posts  power  ppc  pr  precise  prediction  predictive  pregnancies  presidency.  prime  private  pro  professionals  profitable  programming  promote  prosecutors  psoc  pst  ptgui  public.  public  pypy.js  python  python2.7  qemu?  queries  query  questionable  raging  randint  random  range  ranges  rating:teen  raw  read  reading  reality  rebrand  recorded  reference  register  relation  relationship  remarketing  remote  remove  render  rendering  renew  repair  replace  resistance  resource  rest  retargeting?  retractable  revealed  reverberation  reviewing  rom  room  rotation  rows  russia  samsung...  samsung  sanfrancisco  saudi  sc  school  scientists  search  secondary  secure  security  see  seeks  seems  select  seo  seo:  seos  serial  serialnumber  series:stepping  sessions  shape  share  shared  sharedworkers  shares  shingle  should  shoulder  showed  sight  signs  single  siobhan  sites  size  sketchy  skulpt  slice  slick  smart  software  sonogram  space  spaces  spacewarp  spacing  specific  speed  spheres  spotify  spread  stackoverflow  stages  standard  standing  stanford  stars  start  statement  statistical  staub  stock  stones  story  strategy  switching  synchronise  synchronized  synergy  ta-nehisi  tabs  tags  take.  tech  techcrunch  technique  technology  tell  terrified.  tesla  that  that_  the...  the  their  them?)  them  there  these  this  throughout  tickers  ties  time  timestamp  time”  title?  title:a  to  tolearn  too.  toread  totry  tounderstand  traffic  traits?  transcrypt?  transform  transition  transmit  travel.  travel  trolling?  trump  turn  turning  tutorial  two  twostream  u.s.  ultrasound  unfinished  unstable  up  us  usa  use  using  utopia  v5  value  values  vba  vegas  versions  versus  vim  virtualization:  vivo  vix  vl  vps  vr  vs.  vs  vstoxx  warehouse?  warner  warning  warp  warren  was  wasn’t  watch  we  web  webdev  week_  weight  what's  what  what’s  when.  when  which  white  who  whole  wi-fi  widget  will  windows?  windows  wip  wireless  wiring  with  within  worcestershire  word  wordpress  words  work  world  world;  year  yellow  yoast  you  your  |  ||      “in   

Copy this bookmark: