omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Kangaroo

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 1
    • Followers 0
    • Topics 3
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    Kangaroo

    @Kangaroo

    0
    Reputation
    1010
    Profile views
    7
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    Kangaroo Unfollow Follow

    Latest posts made by Kangaroo

    • How to make my 3D scatter graph rotating to view

      This is my program:

      from mpl_toolkits.mplot3d import Axes3D
      import matplotlib.pyplot as plt

      fig = plt.figure()
      ax = fig.add_subplot(111, projection='3d')

      x =[1,2,3,4,5,6,7,8,9,10]
      y =[5,6,2,3,13,4,1,2,4,8]
      z =[2,3,3,3,5,7,9,11,9,10]

      ax.scatter(x, y, z, c='r', marker='o')

      ax.set_xlabel('X Label')
      ax.set_ylabel('Y Label')
      ax.set_zlabel('Z Label')

      plt.show()

      I don't know why my graph is fixed in one position.It is difficult to check every point when my data become larger.
      So,I want to make my graph rotating automatically since it is easy to view every point.
      Does anyone can help me?

      posted in Pythonista
      Kangaroo
      Kangaroo
    • RE: Function Sorted()

      Thank you guys! I solved my problem by importing numpy! Thanks again!

      posted in Pythonista
      Kangaroo
      Kangaroo
    • Function Sorted()

      I got a file of 100 line, each line contains 5 elements such as

      Aberdeen,City,189120,57.14369,-2.09814

      Corresponse to places,type,population,latitude,longitude respectively

      I splited them in 5 arrays and want to use function sorted(population) to rewrite this file ordered by increasing population size.

      However, I can't match them in a right order when I sorted(population),eg.Aberdeen,City,59122,57.14369,-2.09814
      I just made population in a increasing order.

      posted in Pythonista
      Kangaroo
      Kangaroo
    • RE: IndexError happens in pythonista 3

      Thank you guys! I do have a blank line in my file but now it's gone!

      posted in Pythonista
      Kangaroo
      Kangaroo
    • RE: IndexError happens in pythonista 3

      Stake:

      print('x =',splitUP[0],'and y =',splitUP[1]);
      IndexError: list index out of range

      posted in Pythonista
      Kangaroo
      Kangaroo
    • RE: IndexError happens in pythonista 3

      This is my data

      2 1.69
      3 3.25
      4 2.44
      5 3.45
      6 6.29
      7 3.94
      8 5.23
      9 5.78
      10 6.31
      11 8.25
      12 7.84

      Stake:

      ---------------------------below is my program----------------------------

      import matplotlib.pyplot as plt;

      x = [ ];
      y = [ ];

      readFile = open('xy.txt','r');

      for line in readFile:

      print(line);
      
      splitUP = line.split();
      
      print('x =',splitUP[0],'and y =',splitUP[1]);
      
      x.append(splitUP[0]);
      y.append(splitUP[1]);
      

      readFile.close();

      plt.plot(x,y);

      plt.show();

      posted in Pythonista
      Kangaroo
      Kangaroo
    • IndexError happens in pythonista 3

      import matplotlib.pyplot as plt;

      x = [ ];
      y = [ ];

      readFile = open('xy.txt','r');

      for line in readFile:
      # file is open with a line in variable 'line'
      # do something with this line
      print(line);
      # split the line based on whitespace
      splitUP = line.split();

      print('x = ',splitUP[0],'and y = ',splitUP[1]);
      # add x and y to the arrays
      x.append(splitUP[0]);
      y.append(splitUP[1]);
      

      When I run it , it shows IndexError: list index out of the range

      posted in Pythonista
      Kangaroo
      Kangaroo